mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mmc: card: Avoid null pointer dereference
After the null check on md the code jumped to cmd_done, which then will dereference md in mmc_blk_put. This patch avoids the possible null pointer dereference in that case. Signed-off-by: Philippe De Swert <[email protected]> Reviewed-by: Namjae Jeon <[email protected]> Signed-off-by: Chris Ball <[email protected]>
This commit is contained in:
parent
fa5501890d
commit
1c02f000e7
1 changed files with 2 additions and 1 deletions
|
|
@ -384,7 +384,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
|
|||
md = mmc_blk_get(bdev->bd_disk);
|
||||
if (!md) {
|
||||
err = -EINVAL;
|
||||
goto cmd_done;
|
||||
goto cmd_err;
|
||||
}
|
||||
|
||||
card = md->queue.card;
|
||||
|
|
@ -483,6 +483,7 @@ cmd_rel_host:
|
|||
|
||||
cmd_done:
|
||||
mmc_blk_put(md);
|
||||
cmd_err:
|
||||
kfree(idata->buf);
|
||||
kfree(idata);
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue