Skip to content

Commit

Permalink
reset: NULL deref on allocation failure
Browse files Browse the repository at this point in the history
"rstc" is NULL here and we should use "rcdev" instead of "rstc->rcdev".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
Dan Carpenter authored and Philipp Zabel committed Apr 12, 2013
1 parent 61fc413 commit 6034bb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/reset/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6034bb2

Please sign in to comment.