[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db36974a7383bd30037ffda796338c7f4cdfffd7.camel@embedd.com>
Date: Tue, 05 Dec 2023 12:44:41 +0100
From: Daniel Danzberger <dd@...edd.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: woojung.huh@...rochip.com, UNGLinuxDriver@...rochip.com,
netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>, Florian Fainelli
<f.fainelli@...il.com>
Subject: Re: [PATCH] net: dsa: microchip: fix NULL pointer dereference on
platform init
On Tue, 2023-12-05 at 12:12 +0200, Vladimir Oltean wrote:
> On Mon, Dec 04, 2023 at 04:43:15PM +0100, Daniel Danzberger wrote:
> > Fixes a NULL pointer access when registering a switch device that has
> > not been defined via DTS.
> >
> > This might happen when the switch is used on a platform like x86 that
> > doesn't use DTS and instantiates devices in platform specific init code.
> >
> > Signed-off-by: Daniel Danzberger <dd@...edd.com>
> > ---
>
> I'm sorry, I just don't like the state in which your patch leaves the
> driver. Would you mind testing this attached patch instead?
Works fine. I could however only test the platform_data path, not the DTS path.
I would also move the 'enum ksz_chip_id' to the platform include, so instantiating code can use the
enums to set ksz_platform_data.chip_id. (See attached patch)
--
Regards
Daniel Danzberger
embeDD GmbH, Alter Postplatz 2, CH-6370 Stans
View attachment "0001-net-dsa-microchip-properly-support-platform_data-pro.patch" of type "text/x-patch" (5460 bytes)
Powered by blists - more mailing lists