[PATCH 3/4] mtd: core: fix error path for nvmem provider

Miquel Raynal miquel.raynal at bootlin.com
Tue Mar 7 11:23:15 PST 2023


On Mon, 2023-03-06 at 12:58:04 UTC, Michael Walle wrote:
> If mtd_otp_nvmem_add() fails, the partitions won't be removed
> because there is simply no call to del_mtd_partitions().
> Unfortunately, add_mtd_partitions() will print all partitions to
> the kernel console. If mtd_otp_nvmem_add() returns -EPROBE_DEFER
> this would print the partitions multiple times to the kernel
> console. Instead move mtd_otp_nvmem_add() to the beginning of the
> function.
> 
> Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
> Cc: stable at vger.kernel.org
> Signed-off-by: Michael Walle <michael at walle.cc>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel



More information about the linux-mtd mailing list