All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Romli, Khairul Anuar" <khairul.anuar.romli@altera.com>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"open list:SPI NOR SUBSYSTEM" <linux-mtd@lists.infradead.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Gerlach, Matthew" <matthew.gerlach@altera.com>
Subject: Re: [PATCH 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations
Date: Wed, 16 Jul 2025 08:46:02 +0200	[thread overview]
Message-ID: <DBD9ZQ7GV4YY.PLA885RZGBDV@kernel.org> (raw)
In-Reply-To: < <BY5PR03MB5299D68304D916F466837E6BC657A@BY5PR03MB5299.namprd03.prod.outlook.com>


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: "Michael Walle" <mwalle@kernel.org>
To: "Romli, Khairul Anuar" <khairul.anuar.romli@altera.com>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"open list:SPI NOR SUBSYSTEM" <linux-mtd@lists.infradead.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Gerlach, Matthew" <matthew.gerlach@altera.com>
Subject: Re: [PATCH 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations
Date: Wed, 16 Jul 2025 08:46:02 +0200	[thread overview]
Message-ID: <DBD9ZQ7GV4YY.PLA885RZGBDV@kernel.org> (raw)
In-Reply-To: < <BY5PR03MB5299D68304D916F466837E6BC657A@BY5PR03MB5299.namprd03.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  parent reply	other threads:[~2025-07-16  7:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1752024352.git.khairul.anuar.romli@altera.com>
2025-07-09  1:30 ` [PATCH 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations khairul.anuar.romli
2025-07-09  1:30   ` khairul.anuar.romli
2025-07-09  1:34   ` Matthew Gerlach
2025-07-09  1:34     ` Matthew Gerlach
2025-07-09 14:33   ` Michael Walle
2025-07-09 14:33     ` Michael Walle
2025-07-15  7:53     ` Romli, Khairul Anuar
2025-07-15  7:53       ` Romli, Khairul Anuar
     [not found]       ` < <BY5PR03MB5299D68304D916F466837E6BC657A@BY5PR03MB5299.namprd03.prod.outlook.com>
2025-07-16  6:46         ` Michael Walle [this message]
2025-07-16  6:46           ` Michael Walle
2025-07-14 19:29   ` Dan Carpenter
2025-07-14 19:29     ` Dan Carpenter
2025-07-15  0:15     ` Romli, Khairul Anuar
2025-07-15  0:15       ` Romli, Khairul Anuar
2025-07-11  2:17 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DBD9ZQ7GV4YY.PLA885RZGBDV@kernel.org \
    --to=mwalle@kernel.org \
    --cc=khairul.anuar.romli@altera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthew.gerlach@altera.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@linaro.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.