[PATCH master 1/2] nvmem: regmap: fix use of uninitialized space with nvmem_regmap_register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looking through all instances of struct nvmem_config in the tree shows
that only the new nvmem_regmap_register failed to initialize all
members, e.g. config::read_only was uninitialized. Fix this up.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/nvmem/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/regmap.c b/drivers/nvmem/regmap.c
index 346d2516f3c3..641e6413ba0b 100644
--- a/drivers/nvmem/regmap.c
+++ b/drivers/nvmem/regmap.c
@@ -60,7 +60,7 @@ static struct nvmem_bus nvmem_regmap_bus = {
 
 struct nvmem_device *nvmem_regmap_register(struct regmap *map, const char *name)
 {
-	struct nvmem_config config;
+	struct nvmem_config config = {};
 
 	/* Can be retrofitted if needed */
 	if (regmap_get_reg_stride(map) != regmap_get_val_bytes(map))
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux