Re: [net PATCH] net: dsa: qca8k: fix NULL pointer dereference for of_device_get_match_data

From: Christian Marangi
Date: Mon Sep 05 2022 - 12:59:30 EST


On Mon, Sep 05, 2022 at 07:50:39PM +0300, Vladimir Oltean wrote:
> On Sun, Sep 04, 2022 at 11:53:19PM +0200, Christian Marangi wrote:
> > of_device_get_match_data is called on priv->dev before priv->dev is
> > actually set. Move of_device_get_match_data after priv->dev is correctly
> > set to fix this kernel panic.
> >
> > Fixes: 3bb0844e7bcd ("net: dsa: qca8k: cache match data to speed up access")
> > Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
> > ---
>
> Did this ever work? Was it tested when you sent the big refactoring
> patch set?

I have to be honest here. I feel really embarrassed about this.
The short story is that the refactor was tested on Openwrt with 5.15 by
manually applying the changes. This fix was applied there but I forgot
to put it in the final series.

I notice this mistake only now that I'm backporting patches and the
manually applied fix was reset.

Again I'm really sorry.

--
Ansuel