firmware: arm_sdei: Fix return value check in sdei_present_dt()

In case of error, the function of_platform_device_create() returns
NULL pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

Fixes: 677a60bd20 ("firmware: arm_sdei: Discover SDEI support via ACPI")
Acked-by: James Morse <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
This commit is contained in:
Wei Yongjun 2018-01-15 10:41:53 +00:00 • committed by Catalin Marinas
commit 2f7aacf795

View file

@ -1023,7 +1023,7 @@ static bool __init sdei_present_dt(void)
pdev = of_platform_device_create(np, sdei_driver.driver.name, NULL);
of_node_put(np);
if (IS_ERR(pdev))
if (!pdev)
return false;
return true;