From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Juergen Borleis <jbe@pengutronix.de>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! mci: mci-core: add GPP support
Date: Mon, 14 Sep 2020 17:04:30 +0200 [thread overview]
Message-ID: <20200914150430.23818-1-a.fatoum@pengutronix.de> (raw)
1) use %zu for size_t argument, otherwise we read garbage on 64-bit CPUs
2) use xasprintf instead of risking null pointer deref on ENOMEM
Cc: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/mci/mci-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 21eff2f593d8..437ecc76c96f 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -496,8 +496,8 @@ static __maybe_unused void mmc_extract_gpp_partitions(struct mci *mci)
/* Convert to bytes */
part_size *= wpgs;
- partname = basprintf("gpp%d", idx);
- name = basprintf("%s.%s", mci->cdevname, partname);
+ partname = xasprintf("gpp%zu", idx);
+ name = xasprintf("%s.%s", mci->cdevname, partname);
/* TODO read-only flag */
mci_part_add(mci, part_size, EXT_CSD_PART_CONFIG_ACC_GPP0 + idx,
name, partname, idx, false, MMC_BLK_DATA_AREA_GP);
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2020-09-14 15:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 15:04 Ahmad Fatoum [this message]
2020-09-14 18:00 ` 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200914150430.23818-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jbe@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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