[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240429063923.648c927f@kernel.org>
Date: Mon, 29 Apr 2024 06:39:23 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Luiz Angelo Daros de Luca <luizluca@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Alvin Šipraga
<alsi@...g-olufsen.dk>, Andrew Lunn <andrew@...n.ch>, Florian Fainelli
<f.fainelli@...il.com>, Vladimir Oltean <olteanv@...il.com>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Rob Herring <robh+dt@...nel.org>, Krzysztof
Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley
<conor+dt@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH net-next v2 3/3] net: dsa: realtek: add LED drivers for
rtl8366rb
On Sat, 27 Apr 2024 02:11:30 -0300 Luiz Angelo Daros de Luca wrote:
> +static int rtl8366rb_setup_leds(struct realtek_priv *priv)
> +{
> + struct device_node *leds_np, *led_np;
> + struct dsa_switch *ds = &priv->ds;
> + struct dsa_port *dp;
> + int ret = 0;
> +
> + dsa_switch_for_each_port(dp, ds) {
> + if (!dp->dn)
> + continue;
> +
> + leds_np = of_get_child_by_name(dp->dn, "leds");
> + if (!leds_np) {
> + dev_dbg(priv->dev, "No leds defined for port %d",
> + dp->index);
> + continue;
> + }
> +
> + for_each_child_of_node(leds_np, led_np) {
> + ret = rtl8366rb_setup_led(priv, dp,
> + of_fwnode_handle(led_np));
> + if (ret) {
> + of_node_put(led_np);
> + break;
> + }
> + }
> +
> + of_node_put(leds_np);
> + if (ret)
> + return ret;
> + }
> + return 0;
> +}
coccicheck generates this warning:
drivers/net/dsa/realtek/rtl8366rb.c:1032:4-15: ERROR: probable double put.
I think it's a false positive. But aren't you missing a put(dp) before
"return ret;" ?
Powered by blists - more mailing lists