mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
bus: fsl-mc: Check return value of platform_get_resource()
commit25f526507bupstream. platform_get_resource() returns NULL in case of failure, so check its return value and propagate the error in order to prevent NULL pointer dereference. Fixes:6305166c87("bus: fsl-mc: Add ACPI support for fsl-mc") Cc: stable@vger.kernel.org Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/aKwuK6TRr5XNYQ8u@pc Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1a2ea887a5
commit
78e87b8a3c
@@ -1103,6 +1103,9 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
|
||||
* Get physical address of MC portal for the root DPRC:
|
||||
*/
|
||||
plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!plat_res)
|
||||
return -EINVAL;
|
||||
|
||||
mc_portal_phys_addr = plat_res->start;
|
||||
mc_portal_size = resource_size(plat_res);
|
||||
mc_portal_base_phys_addr = mc_portal_phys_addr & ~0x3ffffff;
|
||||
|
||||
Reference in New Issue
Block a user