public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] reset: NULL deref on allocation failure
@ 2013-04-03  5:02 Dan Carpenter
  2013-04-04  7:49 ` Philipp Zabel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dan Carpenter @ 2013-04-03  5:02 UTC (permalink / raw)
  To: kernel-janitors

"rstc" is NULL here and we should use "rcdev" instead of "rstc->rcdev".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-09  8:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03  5:02 [patch] reset: NULL deref on allocation failure Dan Carpenter
2013-04-04  7:49 ` Philipp Zabel
2013-04-04 11:56 ` Shawn Guo
2013-04-04 12:13 ` Dan Carpenter
2013-04-09  8:08 ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox