From 8cb68c83ab99a474ae847602f0c514d0fe17cc82 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 10 Apr 2017 13:54:45 +0200 Subject: [PATCH] drm: Fix get_property logic fumble Yet again I've proven that I can't negate conditions :( Testcase: igt/kms_properties/get_property-sanity Reviewed-by: Maarten Lankhorst Reviewed-by: Sean Paul Fixes: eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl") Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jani Nikula Cc: Sean Paul Reported-by: Tvrtko Ursulin Cc: Tvrtko Ursulin Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20170410115445.13829-1-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index 3feef06..3e88fa2 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c @@ -476,7 +476,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev, drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) { list_for_each_entry(prop_enum, &property->enum_list, head) { enum_count++; - if (out_resp->count_enum_blobs <= enum_count) + if (out_resp->count_enum_blobs < enum_count) continue; if (copy_to_user(&enum_ptr[copied].value, -- 2.7.4