]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
dpaa2-mac: Add a missing of_node_put after of_device_is_available
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 6 Dec 2020 15:13:39 +0000 (16:13 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Dec 2020 01:57:19 +0000 (17:57 -0800)
Add an 'of_node_put()' call when a tested device node is not available.

Fixes: 94ae899b2096 ("dpaa2-mac: add PCS support through the Lynx module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201206151339.44306-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c

index 90cd243070d7add696e1a2192a0eb2df3e93498a..828c177df03d5915d2faeb81fb9ad6b74496f032 100644 (file)
@@ -269,6 +269,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
 
        if (!of_device_is_available(node)) {
                netdev_err(mac->net_dev, "pcs-handle node not available\n");
+               of_node_put(node);
                return -ENODEV;
        }