EDAC/sifive: Fix return value check in ecc_register()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 15 Jan 2020 15:03:03 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:51 +0000 (08:36 +0100)
commitd4870a4343f3d448ade5a3306c477fd28f5e888c
treeb2ea83c1db1c0a544045053827ed047cce90741a
parent0a8f90d5654d802abf589249fc14d12b25dcf4e5
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: 91abaeaaff35 ("EDAC/sifive: Add EDAC platform driver for SiFive SoCs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200115150303.112627-1-weiyongjun1@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/edac/sifive_edac.c