mtd: physmap_of: Release resources on error
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Thu, 4 Oct 2018 13:34:45 +0000 (15:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:23:08 +0000 (08:23 +0100)
commit8660ea2737942aebc4299feeffb492f7f09f5812
tree58d7a474c4f83daccb1ab7ad2fd1aa1f839f170e
parent4d5cc2f0b26217522daa623ca84c044ecfe31c17
mtd: physmap_of: Release resources on error

[ Upstream commit ef0de747f7ad179c7698a5b0e28db05f18ecbf57 ]

During probe, if there was an error the memory region and the memory
map were not properly released.This can lead a system unusable if
deferred probe is in use.

Replace mem_request and map with devm_ioremap_resource

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/maps/physmap_of_core.c