Re: [PATCH] mtd-ram: correctly free memory on error path in platram_probe()

From: Miquel Raynal
Date: Thu Nov 19 2020 - 16:05:38 EST


On Fri, 2020-11-13 at 16:05:37 UTC, Baskov Evgeiny wrote:
> If an error happens in mtd_device_parse_register or mtd_device_register,
> memory allocated for struct platram_info is leaked.
>
> Make platram_probe() call platram_remove() on all error paths
> after struct platram_info allocation to correctly free resources.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Baskov Evgeiny <baskov@xxxxxxxxx>

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

Miquel