Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-21 Thread Marek Vasut
On 9/20/20 9:34 AM, Biju Das wrote: Hi, [...] >>> if we remove writephyext, by looking the code at [1], rxc-skew-ps will be >> taken from the device tree[3] and "txc-skew-pc" will be the default >> value(0xf). >>> [3]https://elixir.bootlin.com/u-boot/v2020.10-rc4/source/arch/arm/dts/ >>>

RE: [PATCH] net: ravb: Fix NULL pointer access

2020-09-20 Thread Biju Das
Hi Marek, Thanks for the feedback. > Subject: Re: [PATCH] net: ravb: Fix NULL pointer access > > On 9/19/20 8:14 PM, Biju Das wrote: > > Hi, > > [...] > > >>>>> By looking at [1], only this driver is using writeext. > >>>>> [1]htt

Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-19 Thread Marek Vasut
On 9/19/20 8:14 PM, Biju Das wrote: Hi, [...] > By looking at [1], only this driver is using writeext. > [1]https://elixir.bootlin.com/u-boot/v2020.10-rc4/A/ident/writeext git grep indicates a couple more sites where the writeext is called. But look into the KSZ9031

RE: [PATCH] net: ravb: Fix NULL pointer access

2020-09-19 Thread Biju Das
Hi Marek, Thanks for the feedback. > Subject: Re: [PATCH] net: ravb: Fix NULL pointer access > > On 9/19/20 1:14 PM, Biju Das wrote: > [...] > >>> By looking at [1], only this driver is using writeext. > >>> [1]https://elixir.bootlin.com/u-boot/v2020.10-rc4

Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-19 Thread Marek Vasut
On 9/19/20 1:14 PM, Biju Das wrote: [...] >>> By looking at [1], only this driver is using writeext. >>> [1]https://elixir.bootlin.com/u-boot/v2020.10-rc4/A/ident/writeext >> >> git grep indicates a couple more sites where the writeext is called. >> But look into the KSZ9031 datasheet, that

RE: [PATCH] net: ravb: Fix NULL pointer access

2020-09-19 Thread Biju Das
Hi Marek, Thanks for the feedback. > Subject: Re: [PATCH] net: ravb: Fix NULL pointer access > > On 9/18/20 5:26 PM, Biju Das wrote: > [...] > > >>>>> +++ b/drivers/net/ravb.c > >>>>> @@ -438,7 +438,8 @@ static int ravb_config(struct udev

Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-18 Thread Marek Vasut
On 9/18/20 5:26 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

RE: [PATCH] net: ravb: Fix NULL pointer access

2020-09-18 Thread Biju Das
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 rav

Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-16 Thread Marek Vasut
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

RE: [PATCH] net: ravb: Fix NULL pointer access

2020-09-16 Thread Biju Das
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) > > > > writ

Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-16 Thread Marek Vasut
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) > +

Re: [PATCH] net: ravb: Fix NULL pointer access

2020-09-15 Thread Michal Simek
On 15. 09. 20 16:10, Biju Das wrote: > Some phy's like rtl8211e do not support writeext() callback. Add a check to > avoid null pointer access before calling writeext() callback. > > Signed-off-by: Biju Das > Reviewed-by: Lad Prabhakar > --- > drivers/net/ravb.c | 3 ++- > 1 file changed, 2

[PATCH] net: ravb: Fix NULL pointer access

2020-09-15 Thread Biju Das
Some phy's like rtl8211e do not support writeext() callback. Add a check to avoid null pointer access before calling writeext() callback. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar --- drivers/net/ravb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git