Re: [PATCH] mtd: core: avoid double-free of OTP NVMEM device
From: Miquel Raynal
Date: Fri Sep 04 2026 - 14:06:15 EST
On Sun, 16 Aug 2026 18:30:27 +0200, Karl Mehltretter wrote:
> If factory OTP setup fails after the user OTP NVMEM device has been
> registered, mtd_otp_nvmem_add() unregisters the user device but leaves
> mtd->otp_user_nvmem set. On an error, the caller unregisters it again.
> For -EOPNOTSUPP, registration continues and normal teardown unregisters
> it again.
>
> Clear mtd->otp_user_nvmem after unregistering it.
>
> [...]
Applied to mtd/fixes, thanks!
[1/1] mtd: core: avoid double-free of OTP NVMEM device
commit: 26300879cd8e4612dce66bb8f6ff7cd35fcf3e59
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl