[PATCH next] drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new()

Dan Carpenter posted 1 patch 11 months, 1 week ago
drivers/gpu/drm/adp/adp_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH next] drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new()
Posted by Dan Carpenter 11 months, 1 week ago
The __drmm_universal_plane_alloc() function doesn't return NULL, it
returns error pointers.  Update the check to match.

Fixes: 332122eba628 ("drm: adp: Add Apple Display Pipe driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/adp/adp_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/adp/adp_drv.c b/drivers/gpu/drm/adp/adp_drv.c
index 0a39abdc9238..db36807005a6 100644
--- a/drivers/gpu/drm/adp/adp_drv.c
+++ b/drivers/gpu/drm/adp/adp_drv.c
@@ -232,9 +232,9 @@ static struct drm_plane *adp_plane_new(struct adp_drv_private *adp)
 					     ALL_CRTCS, &adp_plane_funcs,
 					     plane_formats, ARRAY_SIZE(plane_formats),
 					     NULL, DRM_PLANE_TYPE_PRIMARY, "plane");
-	if (!plane) {
+	if (IS_ERR(plane)) {
 		drm_err(drm, "failed to allocate plane");
-		return ERR_PTR(-ENOMEM);
+		return plane;
 	}
 
 	drm_plane_helper_add(plane, &adp_plane_helper_funcs);
-- 
2.47.2
Re: [PATCH next] drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new()
Posted by Alyssa Rosenzweig 11 months ago
On Fri, 07 Mar 2025 12:30:58 +0300, Dan Carpenter wrote:
> The __drmm_universal_plane_alloc() function doesn't return NULL, it
> returns error pointers.  Update the check to match.
> 
> 

Applied, thanks!

[1/1] drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new()
      (no commit info)

Best regards,
-- 
Alyssa Rosenzweig <alyssa@rosenzweig.io>
Re: [PATCH next] drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new()
Posted by Sasha Finkelstein 11 months, 1 week ago
On Fri, 7 Mar 2025 at 10:31, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> The __drmm_universal_plane_alloc() function doesn't return NULL, it
> returns error pointers.  Update the check to match.
>
> Fixes: 332122eba628 ("drm: adp: Add Apple Display Pipe driver")

Acked-by: Sasha Finkelstein <fnkl.kernel@gmail.com>