Skip to content

Commit

Permalink
firmware: arm_sdei: Fix return value check in sdei_present_dt()
Browse files Browse the repository at this point in the history
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: 677a60b ("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>
  • Loading branch information
Wei Yongjun authored and Catalin Marinas committed Jan 15, 2018
1 parent a22fde8 commit 2f7aacf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/arm_sdei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f7aacf

Please sign in to comment.