diff options
author | Manish Narani <[email protected]> | 2018-10-25 11:36:56 +0530 |
---|---|---|
committer | Borislav Petkov <[email protected]> | 2018-11-05 13:36:20 +0100 |
commit | 84de0b493ff62993c4047dd15318cc23f83923d3 (patch) | |
tree | ae1e2faff6f3ce91a1ffce706caf6ffaf6e69c23 | |
parent | 3d02a8975e321ef6219ec911742d741d2d73c89c (diff) |
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]
-rw-r--r-- | drivers/edac/synopsys_edac.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 1c3795dd7b82..0005ef387af6 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -477,6 +477,9 @@ static int mc_probe(struct platform_device *pdev) return PTR_ERR(baseaddr); p_data = of_device_get_match_data(&pdev->dev); + if (!p_data) + return -ENODEV; + if (!p_data->get_ecc_state(baseaddr)) { edac_printk(KERN_INFO, EDAC_MC, "ECC not enabled\n"); return -ENXIO; |