Re: [PATCH v5] mtd: spi-nor: core: Fix mutex leak in spi_nor_rww_start_exclusive()
From: Miquel Raynal
Date: Thu Aug 27 2026 - 04:33:31 EST
On 27/08/2026 at 16:26:56 +08, Runyu Xiao <runyu.xiao@xxxxxxxxxx> wrote:
> spi_nor_rww_start_exclusive() is used as a wait_event_killable()
> condition. When an RWW operation is already in progress, it returns
> false while still holding nor->lock. The wait condition is then retried,
> but spi_nor_rww_end_exclusive() needs the same lock to clear the RWW
> state, so the wait can deadlock.
This paragraph is a bit irrelevant, we don't really care about the
feature itself: there was a conversion to scoped mutexes, this
conversion missed one place, you fix it. That is the justification, but
fine, let's stop iterating on such a trivial fix.
> Use the same guard(mutex) pattern as the other RWW helpers so nor->lock
> is released on both the busy and successful return paths.
>
> Fixes: 03e7bb864d9a ("mtd: spi-nor: use scope-based mutex cleanup helpers")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
Didn't I send a Reviewed-by tag already?
Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Miquèl