]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: sparx5: Add of_node_put() before goto
authorWan Jiabing <wanjiabing@vivo.com>
Mon, 18 Oct 2021 01:31:30 +0000 (21:31 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 12:44:48 +0000 (13:44 +0100)
Fix following coccicheck warning:
./drivers/net/ethernet/microchip/sparx5/s4parx5_main.c:723:1-33: WARNING: Function
for_each_available_child_of_node should have of_node_put() before goto

Early exits from for_each_available_child_of_node should decrement the
node reference counter.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/sparx5/sparx5_main.c

index cbece6e9bff27a4dff5f1f71e46e6467d826e8c7..5030dfca38798d28c04da06e518171e3bf818d07 100644 (file)
@@ -758,6 +758,7 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
                        err = dev_err_probe(sparx5->dev, PTR_ERR(serdes),
                                            "port %u: missing serdes\n",
                                            portno);
+                       of_node_put(portnp);
                        goto cleanup_config;
                }
                config->portno = portno;