lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJq09z7yykDsh2--ZahDX=Pto9SF+EQUo5hBnrLiWNALeVY_Bw@mail.gmail.com>
Date: Fri, 8 Dec 2023 02:13:25 -0300
From: Luiz Angelo Daros de Luca <luizluca@...il.com>
To: netdev@...r.kernel.org
Cc: linus.walleij@...aro.org, alsi@...g-olufsen.dk, andrew@...n.ch, 
	f.fainelli@...il.com, olteanv@...il.com, davem@...emloft.net, 
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, 
	arinc.unal@...nc9.com
Subject: Re: [PATCH net-next 2/7] net: dsa: realtek: put of node after MDIO registration

> diff --git a/drivers/net/dsa/realtek/realtek-smi.c b/drivers/net/dsa/realtek/realtek-smi.c
> index 755546ed8db6..ddcae546afbc 100644
> --- a/drivers/net/dsa/realtek/realtek-smi.c
> +++ b/drivers/net/dsa/realtek/realtek-smi.c
> @@ -389,15 +389,15 @@ static int realtek_smi_setup_mdio(struct dsa_switch *ds)
>         priv->user_mii_bus->write = realtek_smi_mdio_write;
>         snprintf(priv->user_mii_bus->id, MII_BUS_ID_SIZE, "SMI-%d",
>                  ds->index);
> -       priv->user_mii_bus->dev.of_node = mdio_np;
>         priv->user_mii_bus->parent = priv->dev;
>         ds->user_mii_bus = priv->user_mii_bus;
>
>         ret = devm_of_mdiobus_register(priv->dev, priv->user_mii_bus, mdio_np);
> +       of_node_put(mdio_np);

I would like some advice on this line. I have seen similar code like
this but I'm not sure if a function that receives that node as an
argument should be responsible to call kobject_get() (or alike) if it
keeps a reference for that node. The of_mdiobus_register does not keep
that node but it does get some child nodes. I don't know if it is ok
to free the parent node (if that ever happens when a child is still in
use).

Regards,

Luiz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ