firmware: arm_sdei: Fix return value check in sdei_present_dt()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 15 Jan 2018 10:41:53 +0000 (10:41 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 15 Jan 2018 18:16:59 +0000 (18:16 +0000)
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: 677a60bd2003 ("firmware: arm_sdei: Discover SDEI support via ACPI")
Acked-by: James Morse <james.morse@arm.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/firmware/arm_sdei.c

index 8f6563c595e5c796a4060cf0b5381b89c5acba76..1ea71640fdc21dd6b8b96c93d1383babc6e89a33 100644 (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;