[PATCH] mtd: otp: clean up on error in mtd_otp_nvmem_add()

Linus Walleij linus.walleij at linaro.org
Wed Jun 14 23:33:31 PDT 2023


On Thu, Jun 15, 2023 at 8:09 AM Dan Carpenter <dan.carpenter at linaro.org> wrote:

> Smatch complains that these error paths are missing cleanup:
>
>     drivers/mtd/mtdcore.c:983 mtd_otp_nvmem_add()
>     warn: missing unwind goto?
>
> This needs to call nvmem_unregister(mtd->otp_user_nvmem) before
> returning.
>
> Fixes: 3b270fac8443 ("mtd: otp: Put factory OTP/NVRAM into the entropy pool")
> Signed-off-by: Dan Carpenter <dan.carpenter at linaro.org>

Ooops my bad.
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij



More information about the linux-mtd mailing list