[PATCH] drm/panthor: return PTR_ERR() from devm_drm_dev_alloc()

Osama Abdelkader posted 1 patch 1 week, 2 days ago
drivers/gpu/drm/panthor/panthor_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] drm/panthor: return PTR_ERR() from devm_drm_dev_alloc()
Posted by Osama Abdelkader 1 week, 2 days ago
devm_drm_dev_alloc() returns an ERR_PTR() on failure, but panthor_probe()
always converts that failure to -ENOMEM. Preserve the actual error code
returned by the DRM core instead.

Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/panthor/panthor_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
index 487eedb72ac5..847db031e165 100644
--- a/drivers/gpu/drm/panthor/panthor_drv.c
+++ b/drivers/gpu/drm/panthor/panthor_drv.c
@@ -1824,7 +1824,7 @@ static int panthor_probe(struct platform_device *pdev)
 	ptdev = devm_drm_dev_alloc(&pdev->dev, &panthor_drm_driver,
 				   struct panthor_device, base);
 	if (IS_ERR(ptdev))
-		return -ENOMEM;
+		return PTR_ERR(ptdev);
 
 	platform_set_drvdata(pdev, ptdev);
 
-- 
2.43.0
Re: [PATCH] drm/panthor: return PTR_ERR() from devm_drm_dev_alloc()
Posted by Steven Price 1 day ago
On 16/07/2026 15:03, Osama Abdelkader wrote:
> devm_drm_dev_alloc() returns an ERR_PTR() on failure, but panthor_probe()
> always converts that failure to -ENOMEM. Preserve the actual error code
> returned by the DRM core instead.
> 
> Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>

Reviewed-by: Steven Price <steven.price@arm.com>

I'll apply this to drm-misc-next.

Thanks,
Steve

> ---
>  drivers/gpu/drm/panthor/panthor_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index 487eedb72ac5..847db031e165 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -1824,7 +1824,7 @@ static int panthor_probe(struct platform_device *pdev)
>  	ptdev = devm_drm_dev_alloc(&pdev->dev, &panthor_drm_driver,
>  				   struct panthor_device, base);
>  	if (IS_ERR(ptdev))
> -		return -ENOMEM;
> +		return PTR_ERR(ptdev);
>  
>  	platform_set_drvdata(pdev, ptdev);
>