Skip to content

Commit ee20c69

Browse files
Dan Carpenteralyssarosenzweig
authored andcommitted
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: 332122e ("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>
1 parent 914ee6e commit ee20c69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/adp/adp_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ static struct drm_plane *adp_plane_new(struct adp_drv_private *adp)
232232
ALL_CRTCS, &adp_plane_funcs,
233233
plane_formats, ARRAY_SIZE(plane_formats),
234234
NULL, DRM_PLANE_TYPE_PRIMARY, "plane");
235-
if (!plane) {
235+
if (IS_ERR(plane)) {
236236
drm_err(drm, "failed to allocate plane");
237-
return ERR_PTR(-ENOMEM);
237+
return plane;
238238
}
239239

240240
drm_plane_helper_add(plane, &adp_plane_helper_funcs);

0 commit comments

Comments
 (0)