From: Marek Vasut Date: Wed, 16 Sep 2020 15:53:02 +0200 Subject: [PATCH] net: ravb: Fix NULL pointer access In-Reply-To: <20200915141038.3371-1-biju.das.jz@bp.renesas.com> References: <20200915141038.3371-1-biju.das.jz@bp.renesas.com> Message-ID: <0ae44ba9-0781-906d-537e-f1e115ccd903@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/15/20 4:10 PM, Biju Das wrote: [...] > +++ b/drivers/net/ravb.c > @@ -438,7 +438,8 @@ static int ravb_config(struct udevice *dev) > > writel(mask, eth->iobase + RAVB_REG_ECMR); > > - phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19); > + if (phy->drv->writeext) > + phy->drv->writeext(phy, -1, 0x02, 0x08, (0x0f << 5) | 0x19); Shouldn't we rather move this into the PHY driver altogether ? I _think_ this might be specific to some Micrel PHY.