reset: NULL deref on allocation failure

"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>
This commit is contained in:
Dan Carpenter 2013-04-03 08:02:53 +03:00 committed by Philipp Zabel
parent 61fc413176
commit 6034bb22d8
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}