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

Miquel Raynal
2022-06-09T13:10:33Z

On Mon, 2022-05-16 at 07:06:01 UTC, =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= wrote:
> 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@nod.at>
> Signed-off-by: Michał Kępień <kernel@kempniu.pl>
> Acked-by: Richard Weinberger <richard@nod.at>

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

Miquel