--- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -668,8 +668,10 @@ static int mmc_blk_ioctl_multi_cmd(struc } md = mmc_blk_get(bdev->bd_disk); - if (!md) + if (!md) { + err = -EINVAL; goto cmd_err; + } card = md->queue.card; if (IS_ERR(card)) {