From: Dan Carpenter Date: Fri, 7 Mar 2025 09:30:58 +0000 (+0300) Subject: drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new() X-Git-Tag: v6.15-rc1~12^2~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee20c69c789b6cb2179a535cf440d72b98f4a134;p=thirdparty%2Fkernel%2Flinux.git drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new() 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 Acked-by: Sasha Finkelstein Link: https://patchwork.freedesktop.org/patch/msgid/14a845e8-54d0-45f8-b8b9-927609d92ede@stanley.mountain Signed-off-by: Alyssa Rosenzweig --- diff --git a/drivers/gpu/drm/adp/adp_drv.c b/drivers/gpu/drm/adp/adp_drv.c index 0eeb9e5fab266..c98c647f981d5 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);