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

Commit 6034bb22 authored by Dan Carpenter's avatar Dan Carpenter Committed by Philipp Zabel
Browse files

reset: NULL deref on allocation failure



"rstc" is NULL here and we should use "rcdev" instead of "rstc->rcdev".

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent 61fc4131
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ struct reset_control *reset_control_get(struct device *dev, const char *id)

	rstc = kzalloc(sizeof(*rstc), GFP_KERNEL);
	if (!rstc) {
		module_put(rstc->rcdev->owner);
		module_put(rcdev->owner);
		return ERR_PTR(-ENOMEM);
	}