]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/commitdiff
omap_hsmmc: fix out of bounds array access
authorNikita Kiryanov <nikita@compulab.co.il>
Mon, 3 Dec 2012 02:19:42 +0000 (02:19 +0000)
committerTom Rini <trini@ti.com>
Fri, 8 Mar 2013 21:41:12 +0000 (16:41 -0500)
There are 3 MMC/SD/SDIO controllers in OMAP SoCs, but only 2 structs
are defined for devices. This leads to data being written outside of
array bounds on systems that use all 3 controllers.

Update hsmmc_dev array to the correct size.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
drivers/mmc/omap_hsmmc.c

index afd9b30b513f92b60e74c8419f239e2712ba6958..23dcebdfffa019dd6c7b0e706c0b10e3c971cf90 100644 (file)
@@ -44,7 +44,7 @@
 static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size);
 static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
                        unsigned int siz);
-static struct mmc hsmmc_dev[2];
+static struct mmc hsmmc_dev[3];
 
 #if defined(CONFIG_OMAP44XX) && defined(CONFIG_TWL6030_POWER)
 static void omap4_vmmc_pbias_config(struct mmc *mmc)