diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-04-03 01:02:53 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2013-04-12 04:26:24 -0400 |
commit | 6034bb22d8387708075c083385e5d2e1072a4f33 (patch) | |
tree | efc8599ba0f4ebbec9f7520867ee815d89f9470e /drivers/reset | |
parent | 61fc41317666be400802ac793f47de816ef7bd57 (diff) |
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>
Diffstat (limited to 'drivers/reset')
-rw-r--r-- | drivers/reset/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/reset/core.c b/drivers/reset/core.c index a258277959b4..d1b6089a0ef8 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) | |||
181 | 181 | ||
182 | rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); | 182 | rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); |
183 | if (!rstc) { | 183 | if (!rstc) { |
184 | module_put(rstc->rcdev->owner); | 184 | module_put(rcdev->owner); |
185 | return ERR_PTR(-ENOMEM); | 185 | return ERR_PTR(-ENOMEM); |
186 | } | 186 | } |
187 | 187 | ||