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

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
...@@ -181,7 +181,7 @@ struct reset_control *reset_control_get(struct device *dev, const char *id) ...@@ -181,7 +181,7 @@ struct reset_control *reset_control_get(struct device *dev, const char *id)
rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); rstc = kzalloc(sizeof(*rstc), GFP_KERNEL);
if (!rstc) { if (!rstc) {
module_put(rstc->rcdev->owner); module_put(rcdev->owner);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment