Skip to content
Commit 8c293f54 authored by Baskov Evgeiny's avatar Baskov Evgeiny Committed by Miquel Raynal
Browse files

mtd: plat-ram: correctly free memory on error path in platram_probe()



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: default avatarBaskov Evgeiny <baskov@ispras.ru>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201113160537.899-1-baskov@ispras.ru
parent 875330f8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment