[PATCH] mtd: core: Potential NULL dereference in mtd_otp_size()

Miquel Raynal miquel.raynal at bootlin.com
Wed May 26 02:02:59 PDT 2021


On Fri, 2021-05-14 at 14:27:15 UTC, Dan Carpenter wrote:
> If kmalloc() fails then it could lead to a NULL dereference.  Check and
> return -ENOMEM on error.
> 
> Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> Reviewed-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