[PATCH 2/2] mtdchar: use kvmalloc() for potentially large allocations

Richard Weinberger richard at nod.at
Tue Jun 7 13:30:28 PDT 2022


----- Ursprüngliche Mail -----
> Von: "Michał Kępień" <kernel at kempniu.pl>
> An: "Miquel Raynal" <miquel.raynal at bootlin.com>, "richard" <richard at nod.at>, "Vignesh Raghavendra" <vigneshr at ti.com>
> CC: "linux-mtd" <linux-mtd at lists.infradead.org>, "linux-kernel" <linux-kernel at vger.kernel.org>
> Gesendet: Montag, 16. Mai 2022 09:06:01
> Betreff: [PATCH 2/2] mtdchar: use kvmalloc() for potentially large allocations

> mtdchar_write_ioctl() calls kmalloc() with the 'size' argument set to
> the smaller of two values: the write request's data/OOB length provided
> by user space and the erase block size of the MTD device.  If the latter
> is large, kmalloc() may not be able to serve such allocation requests.
> Use kvmalloc() instead.  Correspondingly, replace kfree() calls with
> kvfree() calls.
> 
> Suggested-by: Richard Weinberger <richard at nod.at>
> Signed-off-by: Michał Kępień <kernel at kempniu.pl>

Looks good to me.
Acked-by: Richard Weinberger <richard at nod.at>

Thanks,
//richard



More information about the linux-mtd mailing list