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

Miquel Raynal miquel.raynal at bootlin.com
Thu Nov 19 16:05:33 EST 2020


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 at ispras.ru>

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

Miquel



More information about the linux-mtd mailing list