drm: Fix get_property logic fumble
authorDaniel Vetter <[email protected]>
Mon, 10 Apr 2017 11:54:45 +0000 (13:54 +0200)
committerDaniel Vetter <[email protected]>
Wed, 12 Apr 2017 16:11:32 +0000 (18:11 +0200)
Yet again I've proven that I can't negate conditions :(

Testcase: igt/kms_properties/get_property-sanity
Reviewed-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Fixes: eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")
Cc: Maarten Lankhorst <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Reported-by: Tvrtko Ursulin <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_property.c

index 3feef0659940c97025ce69349bda0c41f807c18f..3e88fa24eab3d382b037a873c6849fe32ead1d46 100644 (file)
@@ -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,