Thread (3 messages) 3 messages, 2 authors, 2021-06-21
STALE1862d

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

From: Ahmad Fatoum <a.fatoum@pengutronix.de>
Date: 2021-06-19 03:33:36
Subsystem: nvmem framework, the rest · Maintainers: Srinivas Kandagatla, Linus Torvalds

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@pengutronix.de>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help