mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 09:28:44 -04:00
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:
committed by
Philipp Zabel
parent
61fc413176
commit
6034bb22d8
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user