Commit 6e0718f2 authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by Boris Brezillon

drm/panthor: Fix NULL vs IS_ERR() bug in panthor_probe()

The devm_drm_dev_alloc() function returns error pointers.
Update the error handling to check for error pointers instead of NULL.

Fixes: 4bdca115 ("drm/panthor: Add the driver frontend block")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104041.1689951-1-harshit.m.mogalapalli@oracle.com
parent 2b589078
...@@ -1400,7 +1400,7 @@ static int panthor_probe(struct platform_device *pdev) ...@@ -1400,7 +1400,7 @@ static int panthor_probe(struct platform_device *pdev)
ptdev = devm_drm_dev_alloc(&pdev->dev, &panthor_drm_driver, ptdev = devm_drm_dev_alloc(&pdev->dev, &panthor_drm_driver,
struct panthor_device, base); struct panthor_device, base);
if (!ptdev) if (IS_ERR(ptdev))
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(pdev, ptdev); platform_set_drvdata(pdev, ptdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment