]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/plane: Fix IS_ERR() vs NULL check in drm_plane_create_hotspot_properties()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 3 Dec 2025 17:35:23 +0000 (20:35 +0300)
committerMaxime Ripard <mripard@kernel.org>
Fri, 5 Dec 2025 09:07:58 +0000 (10:07 +0100)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patch.msgid.link/aTB023cfcIPkCsFS@stanley.mountain
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/drm_plane.c

index a30493ed97157fac03731775c9d12b3670469862..4cadea997129da46f21e92e0b1aa3005259ba5a7 100644 (file)
@@ -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);