mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <>
Cc: Ahmad Fatoum <>
Subject: [PATCH master 1/2] nvmem: regmap: fix use of uninitialized space with nvmem_regmap_register
Date: Sat, 19 Jun 2021 05:32:11 +0200	[thread overview]
Message-ID: <> (raw)

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 <>
 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))

barebox mailing list

             reply	other threads:[~2021-06-19  3:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-19  3:32 Ahmad Fatoum [this message]
2021-06-19  3:32 ` [PATCH master 2/2] nvmem: fix mismatch between extern and inline stub prototypes Ahmad Fatoum
2021-06-21  5:02 ` [PATCH master 1/2] nvmem: regmap: fix use of uninitialized space with nvmem_regmap_register Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox