From bd39552e0f4d7303f04fc7cae77b8b412e1a45db Mon Sep 17 00:00:00 2001 From: Michael Brandt Date: Wed, 10 Nov 2010 16:27:37 +0100 Subject: U8500: crashdump: check find_mmc_device() return code Fixed: Dereferencing possibly NULL "mmc" in call to function "mmc_init" ST-Ericsson ID: 273353 Change-Id: Ie75546c9e26b638d7cd7fe122a1180418b48df14 Signed-off-by: Michael Brandt Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/8367 Reviewed-by: Mikael LARSSON1 --- board/st/u8500/cmd_cdump.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'board') diff --git a/board/st/u8500/cmd_cdump.c b/board/st/u8500/cmd_cdump.c index 9b203ab83..87ae2a793 100644 --- a/board/st/u8500/cmd_cdump.c +++ b/board/st/u8500/cmd_cdump.c @@ -251,6 +251,10 @@ static int wait_for_mmc(void) struct mmc *mmc; mmc = find_mmc_device(CONFIG_MMC_DEV_NUM); + if (!mmc) { + printf("MMC device %d not found\n", CONFIG_MMC_DEV_NUM); + return 1; + } while (mmc_init(mmc) != 0) { printf("Insert MMC/SD card or press ctrl-c to abort\n"); putc('.'); -- cgit v1.2.3