Skip to content

Commit 84de0b4

Browse files
mnaranisuryasaimadhu
authored andcommitted
EDAC, synopsys: Add error handling for the of_device_get_match_data() result
The function of_device_get_match_data() can return NULL in case of error. Add error handling for the same in the mc_probe() function. Signed-off-by: Manish Narani <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> CC: Mauro Carvalho Chehab <[email protected]> CC: Michal Simek <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] CC: linux-edac <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected] Link: http://lkml.kernel.org/r/[email protected]
1 parent 3d02a89 commit 84de0b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/edac/synopsys_edac.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ static int mc_probe(struct platform_device *pdev)
477477
return PTR_ERR(baseaddr);
478478

479479
p_data = of_device_get_match_data(&pdev->dev);
480+
if (!p_data)
481+
return -ENODEV;
482+
480483
if (!p_data->get_ecc_state(baseaddr)) {
481484
edac_printk(KERN_INFO, EDAC_MC, "ECC not enabled\n");
482485
return -ENXIO;

0 commit comments

Comments
 (0)