Skip to content

Commit 01d9f30

Browse files
Dan Carpenterjannau
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>
1 parent 261f235 commit 01d9f30

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/adp/adp_drv.c

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

241241
drm_plane_helper_add(plane, &adp_plane_helper_funcs);

0 commit comments

Comments
 (0)