mmc: check find_mmc_device return value

find_mmc_device returns NULL if an invalid device number is specified.
Check for this to avoid dereferencing NULL pointers.

Signed-off-by: Rabin Vincent <rabin@rab.in>
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 7791c38..70b4130 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -846,7 +846,7 @@
 {
 	struct mmc *mmc = find_mmc_device(dev);
 
-	return &mmc->block_dev;
+	return mmc ? &mmc->block_dev : NULL;
 }
 
 int mmc_init(struct mmc *mmc)