Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5b0ac46 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: Check for NULL pointer access in ioctl"

parents 4411c560 b0f45823
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -638,9 +638,8 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
		return -EPERM;

	idata = mmc_blk_ioctl_copy_from_user(ic_ptr);
	if (IS_ERR(idata))
	if (IS_ERR_OR_NULL(idata))
		return PTR_ERR(idata);

	md = mmc_blk_get(bdev->bd_disk);
	if (!md) {
		err = -EINVAL;
@@ -648,7 +647,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
	}

	card = md->queue.card;
	if (IS_ERR(card)) {
	if (IS_ERR_OR_NULL(card)) {
		err = PTR_ERR(card);
		goto cmd_done;
	}
+4 −0
Original line number Diff line number Diff line
@@ -1222,6 +1222,10 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
{
	unsigned int mult;

	if (!card) {
		WARN_ON(1);
		return;
	}
	/*
	 * SDIO cards only define an upper 1 s limit on access.
	 */