[PATCH] net: ravb: Fix NULL pointer access

Biju Das biju.das.jz at bp.renesas.com
Wed Sep 16 17:43:01 CEST 2020


Hi Marek,

Thanks for the review.

> Subject: Re: [PATCH] net: ravb: Fix NULL pointer access
>
> 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 ?

If I fix, the phydriver with empty function, compiler will complain about unused parameter right?
What about other phy's which doesn't have this callback.

> I _think_ this might be specific to some Micrel PHY.
As mentioned in the commit message, it is seen with Realtek phy(rtl8211e)  and crash seen on Hihope RZ/G2M board.


Thanks and regards,
biju





Renesas Electronics Europe GmbH, Geschaeftsfuehrer/President: Carsten Jauch, Sitz der Gesellschaft/Registered office: Duesseldorf, Arcadiastrasse 10, 40472 Duesseldorf, Germany, Handelsregister/Commercial Register: Duesseldorf, HRB 3708 USt-IDNr./Tax identification no.: DE 119353406 WEEE-Reg.-Nr./WEEE reg. no.: DE 14978647


More information about the U-Boot mailing list