mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
EDAC/sifive: Fix return value check in ecc_register()
[ Upstream commit 6cd18453b68942913fd3b1913b707646e544c2ac ]
In case of error, the function edac_device_alloc_ctl_info() returns a
NULL pointer, not ERR_PTR(). Replace the IS_ERR() test in the return
value check with a NULL test.
Fixes: 91abaeaaff ("EDAC/sifive: Add EDAC platform driver for SiFive SoCs")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
0a8f90d565
commit
d4870a4343
1 changed files with 2 additions and 2 deletions
|
|
@ -54,8 +54,8 @@ static int ecc_register(struct platform_device *pdev)
|
|||
p->dci = edac_device_alloc_ctl_info(0, "sifive_ecc", 1, "sifive_ecc",
|
||||
1, 1, NULL, 0,
|
||||
edac_device_alloc_index());
|
||||
if (IS_ERR(p->dci))
|
||||
return PTR_ERR(p->dci);
|
||||
if (!p->dci)
|
||||
return -ENOMEM;
|
||||
|
||||
p->dci->dev = &pdev->dev;
|
||||
p->dci->mod_name = "Sifive ECC Manager";
|
||||
|
|
|
|||
Loading…
Reference in a new issue