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

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

Merge "[media] xc2028: avoid use after free"

parents 61a53d80 2a470e60
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1403,11 +1403,12 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg)
	 * in order to avoid troubles during device release.
	 */
	kfree(priv->ctrl.fname);
	priv->ctrl.fname = NULL;
	memcpy(&priv->ctrl, p, sizeof(priv->ctrl));
	if (p->fname) {
		priv->ctrl.fname = kstrdup(p->fname, GFP_KERNEL);
		if (priv->ctrl.fname == NULL)
			rc = -ENOMEM;
			return -ENOMEM;
	}

	/*
+7 −1
Original line number Diff line number Diff line
@@ -788,8 +788,14 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
		return k;	/* probably out of space --> ENOMEM */
	}
	if (atomic_read(&sdp->detaching)) {
		if (srp->bio)
		if (srp->bio) {
			if (srp->rq->cmd != srp->rq->__cmd)
				kfree(srp->rq->cmd);

			blk_end_request_all(srp->rq, -EIO);
			srp->rq = NULL;
		}

		sg_finish_rem_req(srp);
		return -ENODEV;
	}