[PATCH] mtd: return -ENOMEM when kmalloc failed
Miquel Raynal
miquel.raynal at bootlin.com
Mon May 10 03:43:46 PDT 2021
On Mon, 2021-04-26 at 09:32:23 UTC, Yang Li wrote:
> The driver is using -1 instead of the -ENOMEM defined macro to
> specify that a buffer allocation failed. Using the correct error
> code is more intuitive
>
> Smatch tool warning:
> drivers/mtd/inftlmount.c:333 check_free_sectors() warn: returning -1
> instead of -ENOMEM is sloppy
> drivers/mtd/nftlmount.c:272 check_free_sectors() warn: returning -1
> instead of -ENOMEM is sloppy
>
> No functional change, just more standardized.
>
> Reported-by: Abaci Robot <abaci at linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee at linux.alibaba.com>
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