From 6bb4b4bc3554c87c342ecbe69fd4a79af7e32741 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Fri, 10 Aug 2012 08:59:12 +0000 Subject: [PATCH] mmc_get_dev: Return error if mmc_init fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Benoît Thébaudeau Cc: Andy Fleming Signed-off-by: Andy Fleming --- drivers/mmc/mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 64abe5b1c8..a60cfe1cb0 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1286,10 +1286,9 @@ int mmc_register(struct mmc *mmc) block_dev_desc_t *mmc_get_dev(int dev) { struct mmc *mmc = find_mmc_device(dev); - if (!mmc) + if (!mmc || mmc_init(mmc)) return NULL; - mmc_init(mmc); return &mmc->block_dev; } #endif -- 2.39.5