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: 332122eba6 ("drm: adp: Add Apple Display Pipe driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/14a845e8-54d0-45f8-b8b9-927609d92ede@stanley.mountain
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Dan Carpenter 2025-03-07 12:30:58 +03:00 committed by Alyssa Rosenzweig
parent 914ee6e730
commit ee20c69c78

View File

@ -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);