Procházet zdrojové kódy

dmaengine: fsl_raid: add missing of_node_put() in fsl_re_probe()

When terminating for_each_compatible_node() iteration with
break or return, of_node_put() should be used to prevent
stale device node references from being left behind.

Found by Coccinelle.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Wei Yongjun před 9 roky
rodič
revize
93e11eb1b7
1 změnil soubory, kde provedl 1 přidání a 0 odebrání
  1. 1 0
      drivers/dma/fsl_raid.c

+ 1 - 0
drivers/dma/fsl_raid.c

@@ -836,6 +836,7 @@ static int fsl_re_probe(struct platform_device *ofdev)
 		rc = of_property_read_u32(np, "reg", &off);
 		rc = of_property_read_u32(np, "reg", &off);
 		if (rc) {
 		if (rc) {
 			dev_err(dev, "Reg property not found in JQ node\n");
 			dev_err(dev, "Reg property not found in JQ node\n");
+			of_node_put(np);
 			return -ENODEV;
 			return -ENODEV;
 		}
 		}
 		/* Find out the Job Rings present under each JQ */
 		/* Find out the Job Rings present under each JQ */