mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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: 8f7179a102 ("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>
This commit is contained in:
parent
35e282c186
commit
479acb9db3
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user