Prechádzať zdrojové kódy

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>
Dan Carpenter 12 rokov pred
rodič
commit
6034bb22d8
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      drivers/reset/core.c

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