aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@nokia.com>2009-03-23 21:23:46 -0400
committerTony Lindgren <tony@atomide.com>2009-03-23 21:51:22 -0400
commit8466032d862a2e52d73af3311bc97f950aaa36c8 (patch)
treecba5a396e739d33b55ea58f922123c7e3cbfef86 /arch/arm
parentb9d766c767d53a9be1f741a53fe8151354ba1da3 (diff)
ARM: OMAP3: mmc-twl4030 fix name buffer length, v2
Add 1 to buffer length for null terminator and use snprintf. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 437f52073f6e..84cac87537a3 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -59,7 +59,7 @@ static struct twl_mmc_controller {
59 struct omap_mmc_platform_data *mmc; 59 struct omap_mmc_platform_data *mmc;
60 u8 twl_vmmc_dev_grp; 60 u8 twl_vmmc_dev_grp;
61 u8 twl_mmc_dedicated; 61 u8 twl_mmc_dedicated;
62 char name[HSMMC_NAME_LEN]; 62 char name[HSMMC_NAME_LEN + 1];
63} hsmmc[] = { 63} hsmmc[] = {
64 { 64 {
65 .twl_vmmc_dev_grp = VMMC1_DEV_GRP, 65 .twl_vmmc_dev_grp = VMMC1_DEV_GRP,
@@ -349,7 +349,8 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
349 return; 349 return;
350 } 350 }
351 351
352 sprintf(twl->name, "mmc%islot%i", c->mmc, 1); 352 snprintf(twl->name, ARRAY_SIZE(twl->name), "mmc%islot%i",
353 c->mmc, 1);
353 mmc->slots[0].name = twl->name; 354 mmc->slots[0].name = twl->name;
354 mmc->nr_slots = 1; 355 mmc->nr_slots = 1;
355 mmc->slots[0].ocr_mask = MMC_VDD_165_195 | 356 mmc->slots[0].ocr_mask = MMC_VDD_165_195 |