mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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]
This commit is contained in:
parent
3d02a8975e
commit
84de0b493f
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue