Subject: Re: [PATCH net-next 2/6] net: pcs: xpcs: add xpcs_create_mdiodev()

From: "Russell King (Oracle)" <[email-masked]>
Date: Mon, 29 May 2023 17:05:13 +0100

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!