From: Dan Carpenter Date: Wed, 3 Apr 2013 05:02:53 +0000 (+0300) Subject: reset: NULL deref on allocation failure X-Git-Tag: v3.10-rc1~102^2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6034bb22d8387708075c083385e5d2e1072a4f33;p=platform%2Fkernel%2Flinux-stable.git reset: NULL deref on allocation failure "rstc" is NULL here and we should use "rcdev" instead of "rstc->rcdev". Signed-off-by: Dan Carpenter Signed-off-by: Philipp Zabel --- diff --git a/drivers/reset/core.c b/drivers/reset/core.c index a258277..d1b6089 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -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); }