[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZHTNOepLuMCcDNTu@shell.armlinux.org.uk>
Date: Mon, 29 May 2023 17:05:13 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Jiawen Wu <jiawenwu@...stnetic.com>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Simon Horman <simon.horman@...igine.com>,
Jose Abreu <Jose.Abreu@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/6] net: pcs: xpcs: add xpcs_create_mdiodev()
On Mon, May 29, 2023 at 05:25:45PM +0200, Andrew Lunn wrote:
> > void xpcs_destroy(struct dw_xpcs *xpcs)
> > {
> > + if (xpcs)
> > + mdio_device_put(xpcs->mdiodev);
> > kfree(xpcs);
> > }
>
> Nit:
>
> Is the if () needed? Can destroy be called if create was not
> successful?
kfree(NULL) is a no-op, so xpcs_destroy() will not oops if passed a NULL
pointer. So it makes sense to preserve this.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists