Message ID | 1470836696-11921-1-git-send-email-weiyj.lk@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Wed, Aug 10, 2016 at 01:44:56PM +0000, Wei Yongjun wrote: > 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. Applied, thanks
diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c index a8c8b9e..303623f 100644 --- a/drivers/dma/fsl_raid.c +++ b/drivers/dma/fsl_raid.c @@ -828,6 +828,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 */
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> --- drivers/dma/fsl_raid.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html