From: Harshit Mogalapalli Date: Tue, 2 Apr 2024 10:40:40 +0000 (-0700) Subject: drm/panthor: Fix NULL vs IS_ERR() bug in panthor_probe() X-Git-Tag: io_uring-6.10-20240523~68^2~25^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=6e0718f21feda0ed97f932cee39b676817e457f2;p=linux-block.git 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: 4bdca1150792 ("drm/panthor: Add the driver frontend block") Signed-off-by: Harshit Mogalapalli Reviewed-by: Boris Brezillon Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20240402104041.1689951-1-harshit.m.mogalapalli@oracle.com --- diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c index 730dd0c69cb8..5e3dc701d26d 100644 --- a/drivers/gpu/drm/panthor/panthor_drv.c +++ b/drivers/gpu/drm/panthor/panthor_drv.c @@ -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);