]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mailbox: zynq: add missing of_node_put before return
authorWang Qing <wangqing@vivo.com>
Mon, 13 Dec 2021 09:44:20 +0000 (01:44 -0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Wed, 12 Jan 2022 05:47:32 +0000 (23:47 -0600)
Fix following coccicheck warning:
WARNING: Function "for_each_available_child_of_node"
should have of_node_put() before return.

Early exits from for_each_available_child_of_node should decrement the
node reference counter.

Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/zynqmp-ipi-mailbox.c

index f44079d62b1a746b9d59b5c12a5648bc82d50185..31a0fa9142744ccd7dbe4633aaa726041fff5691 100644 (file)
@@ -655,6 +655,7 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
                mbox->pdata = pdata;
                ret = zynqmp_ipi_mbox_probe(mbox, nc);
                if (ret) {
+                       of_node_put(nc);
                        dev_err(dev, "failed to probe subdev.\n");
                        ret = -EINVAL;
                        goto free_mbox_dev;