[PATCH 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations

Michael Walle mwalle at kernel.org
Tue Jul 15 23:46:02 PDT 2025


Hi,

On Tue Jul 15, 2025 at 9:53 AM CEST, Khairul Anuar Romli wrote:
> > > -     module_put(dev->driver->owner);
> > > +     if (dev && dev->driver && dev->driver->owner)
> > > +             module_put(dev->driver->owner);
> > 
> > Why is dev->driver or dev->driver->owner NULL in the first place?
>
> When we remove/unbind the the spi node during busy, we will hit
> with dev->driver and dev->driver->owner NULL derefence.

Yes, but my question was why is this the case? I.e. why is
dev or dev->driver NULL?

-michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 297 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20250716/312cce38/attachment.sig>


More information about the linux-mtd mailing list