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: 4bdca11507 ("drm/panthor: Add the driver frontend block")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104041.1689951-1-harshit.m.mogalapalli@oracle.com
This commit is contained in:
Harshit Mogalapalli 2024-04-02 03:40:40 -07:00 committed by Boris Brezillon
parent 2b58907860
commit 6e0718f21f

View File

@ -1400,7 +1400,7 @@ static int panthor_probe(struct platform_device *pdev)
ptdev = devm_drm_dev_alloc(&pdev->dev, &panthor_drm_driver,
struct panthor_device, base);
if (!ptdev)
if (IS_ERR(ptdev))
return -ENOMEM;
platform_set_drvdata(pdev, ptdev);