reset: NULL deref on allocation failure
Subsystems (2)
PATCH 1/1 reset: NULL deref on allocation failure
"rstc" is NULL here and we should use "rcdev" instead of "rstc->rcdev".
drivers/reset/core.c +1 -1
@@ -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 ); }
Hi Dan,
Am Mittwoch, den 03.04.2013, 08:02 +0300 schrieb Dan Carpenter:
Quoted 9 lines
"rstc" is NULL here and we should use "rcdev" instead of "
rstc->rcdev".Signed-off-by Dan Carpenter <[email protected]>drivers/reset/core.c +0
-0
drivers/reset/core.c struct reset_control *reset_control_get(struct device *dev, const char *id) · line 186
Quoted 7 lines
drivers/reset/core.c +1
-1@@ -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 ); }
thanks
Philipp
Philipp,
Quoted 13 lines · Philipp Zabel
Hi Dan,
Am Mittwoch, den 03.04.2013, 08:02 +0300 schrieb Dan Carpenter:
Quoted 10 lines
"rstc" is NULL here and we should use "rcdev" instead of "
rstc->rcdev".Signed-off-by Dan Carpenter <[email protected]>drivers/reset/core.c +0
-0@@ -181,7 +181,7 @@ struct reset_control *reset_control_get(struct device *dev, const char *id)
Quoted 9 lines
drivers/reset/core.c struct reset_control *reset_control_get(struct device *dev, const char *id) · line 186
Quoted 6 lines
drivers/reset/core.c +1
-1rstc =kzalloc (sizeof (*rstc),GFP_KERNEL );if (!rstc) { -module_put (rstc->rcdev->owner); +module_put (rcdev->owner);return ERR_PTR (-ENOMEM ); }Acked-by Philipp Zabel <[email protected]>
I think you should take care of the patch to have it merged through the same path that the 'reset API' series goes to mainline.
Shawn
Quoted 3 lines · Shawn Guo
I think you should take care of the patch to have it merged through the same path that the 'reset API' series goes to mainline.
That's fine by me as well.
regards,
dan carpenter
Philipp Zabel
maintainerAm Donnerstag, den 04.04.2013, 15:13 +0300 schrieb Dan Carpenter:
Quoted 6 lines · Shawn Guo
Quoted 3 lines
I think you should take care of the patch to have it merged through the same path that the 'reset API' series goes to mainline.
That's fine by me as well.
Ok, I've added the patch on top of the branchgit://git.pengutronix.de/git/pza/linux.git reset/for_v3.10 for Olof to pull.
regards
Philipp