diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e62fde3ac431c111ec945d4aba9c877f6308d81d..c13ba2ab19d63663ba72c08b969ef6bc38f9e7bf 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -355,8 +355,10 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( goto idata_err; } - if (!idata->buf_bytes) + if (!idata->buf_bytes) { + idata->buf = NULL; return idata; + } idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL); if (!idata->buf) {