dmaengine: fsl_raid: add missing of_node_put() in fsl_re_probe()
authorWei Yongjun <weiyj.lk@gmail.com>
Wed, 10 Aug 2016 13:44:56 +0000 (13:44 +0000)
committerVinod Koul <vinod.koul@intel.com>
Mon, 22 Aug 2016 06:21:34 +0000 (11:51 +0530)
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>
drivers/dma/fsl_raid.c

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