[PATCH] net: ravb: Fix NULL pointer access

Biju Das biju.das.jz at bp.renesas.com
Fri Sep 18 17:26:55 CEST 2020


Hi Marek,

Thanks for the feedback.

> Subject: Re: [PATCH] net: ravb: Fix NULL pointer access
>
> On 9/16/20 5:43 PM, Biju Das wrote:
> > Hi Marek,
>
> Hi,
>
> [...]
>
> >>> +++ 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 mean, should we not move this entire code which configures something in a
> Micrel PHY, and is specific to Micrel PHY, into the Micrel PHY driver and
> remove the whole call of writeext from this ethernet driver ?

Ok , this function is invoked during data transfer. We could remove this function and test on all RCar boards to see any issues present or not?
By looking at [1], only this driver is using writeext.
[1]https://elixir.bootlin.com/u-boot/v2020.10-rc4/A/ident/writeext

Cheers,
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