Commit 8466032d authored by Adrian Hunter's avatar Adrian Hunter Committed by Tony Lindgren

ARM: OMAP3: mmc-twl4030 fix name buffer length, v2

Add 1 to buffer length for null terminator and use snprintf.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@nokia.com>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b9d766c7
...@@ -59,7 +59,7 @@ static struct twl_mmc_controller { ...@@ -59,7 +59,7 @@ static struct twl_mmc_controller {
struct omap_mmc_platform_data *mmc; struct omap_mmc_platform_data *mmc;
u8 twl_vmmc_dev_grp; u8 twl_vmmc_dev_grp;
u8 twl_mmc_dedicated; u8 twl_mmc_dedicated;
char name[HSMMC_NAME_LEN]; char name[HSMMC_NAME_LEN + 1];
} hsmmc[] = { } hsmmc[] = {
{ {
.twl_vmmc_dev_grp = VMMC1_DEV_GRP, .twl_vmmc_dev_grp = VMMC1_DEV_GRP,
...@@ -349,7 +349,8 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) ...@@ -349,7 +349,8 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
return; return;
} }
sprintf(twl->name, "mmc%islot%i", c->mmc, 1); snprintf(twl->name, ARRAY_SIZE(twl->name), "mmc%islot%i",
c->mmc, 1);
mmc->slots[0].name = twl->name; mmc->slots[0].name = twl->name;
mmc->nr_slots = 1; mmc->nr_slots = 1;
mmc->slots[0].ocr_mask = MMC_VDD_165_195 | mmc->slots[0].ocr_mask = MMC_VDD_165_195 |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment