[PATCH 18/18] DO NOT SUBMIT: drm_next fixup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 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
@@ -459,41 +459,41 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
 	out_resp->flags = property->flags;
 
 	value_count = property->num_values;
 	values_ptr = u64_to_user_ptr(out_resp->values_ptr);
 
 	for (i = 0; i < value_count; i++) {
 		if (i < out_resp->count_values &&
 		    put_user(property->values[i], values_ptr + i)) {
 			return -EFAULT;
 		}
 	}
 	out_resp->count_values = value_count;
 
 	copied = 0;
 	enum_ptr = u64_to_user_ptr(out_resp->enum_blob_ptr);
 
 	if (drm_property_type_is(property, DRM_MODE_PROP_ENUM) ||
 	    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,
 					 &prop_enum->value, sizeof(uint64_t)))
 				return -EFAULT;
 
 			if (copy_to_user(&enum_ptr[copied].name,
 					 &prop_enum->name, DRM_PROP_NAME_LEN))
 				return -EFAULT;
 			copied++;
 		}
 		out_resp->count_enum_blobs = enum_count;
 	}
 
 	/*
 	 * NOTE: The idea seems to have been to use this to read all the blob
 	 * property values. But nothing ever added them to the corresponding
 	 * list, userspace always used the special-purpose get_blob ioctl to
 	 * read the value for a blob property. It also doesn't make a lot of
 	 * sense to return values here when everything else is just metadata for
-- 
2.9.3



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux