Skip to contentSkip to conversation

drm/plane: Fix IS_ERR() vs NULL check in drm_plane_create_hotspot_properties()

PATCH In review Dan Carpenter 2 participants 2 messages Dec 3, 2025 – Dec 4, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 8f7179a1027d ("drm/atomic: Add support for mouse hotspots")
---
 drivers/gpu/drm/drm_plane.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_plane.c +4 -4
index f72bfbdddf23..6ee752c90380 100644
@@ -338,14 +338,14 @@ static int drm_plane_create_hotspot_properties(struct drm_plane *plane)
 
 	prop_x = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_X",
 						  INT_MIN, INT_MAX);
-	if (IS_ERR(prop_x))
-		return PTR_ERR(prop_x);
+	if (!prop_x)
+		return -ENOMEM;
 
 	prop_y = drm_property_create_signed_range(plane->dev, 0, "HOTSPOT_Y",
 						  INT_MIN, INT_MAX);
-	if (IS_ERR(prop_y)) {
+	if (!prop_y) {
 		drm_property_destroy(plane->dev, prop_x);
-		return PTR_ERR(prop_y);
+		return -ENOMEM;
 	}
 
 	drm_object_attach_property(&plane->base, prop_x, 0);
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw

Dan Carpenter <[email protected]> writes:

Hello Dan,

Quoted 6 lines

The drm_property_create_signed_range() function doesn't return error pointers it returns NULL on error. Fix the error checking to match.

Fixes 8f7179a1027d ("drm/atomic: Add support for mouse hotspots")

---

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat