Skip to content

Commit 479acb9

Browse files
Dan Carpentermripard
authored andcommitted
drm/plane: Fix IS_ERR() vs NULL check in drm_plane_create_hotspot_properties()
The drm_property_create_signed_range() function doesn't return error pointers it returns NULL on error. Fix the error checking to match. Fixes: 8f7179a ("drm/atomic: Add support for mouse hotspots") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Zack Rusin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent 35e282c commit 479acb9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/drm_plane.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,14 @@ static int drm_plane_create_hotspot_properties(struct drm_plane *plane)
338338

339339
prop_x = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_X",
340340
INT_MIN, INT_MAX);
341-
if (IS_ERR(prop_x))
342-
return PTR_ERR(prop_x);
341+
if (!prop_x)
342+
return -ENOMEM;
343343

344344
prop_y = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_Y",
345345
INT_MIN, INT_MAX);
346-
if (IS_ERR(prop_y)) {
346+
if (!prop_y) {
347347
drm_property_destroy(plane->dev, prop_x);
348-
return PTR_ERR(prop_y);
348+
return -ENOMEM;
349349
}
350350

351351
drm_object_attach_property(&plane->base, prop_x, 0);

0 commit comments

Comments
 (0)