[Intel-gfx] [PATCH] drm: Fix get_property logic fumble

Sean Paul seanpaul at chromium.org
Mon Apr 10 17:16:36 UTC 2017


On Mon, Apr 10, 2017 at 01:54:45PM +0200, Daniel Vetter wrote:
> Yet again I've proven that I can't negate conditions :(
> 
> Fixes: eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Jani Nikula <jani.nikula at linux.intel.com>
> Cc: Sean Paul <seanpaul at chromium.org>

Reviewed-by: Sean Paul <seanpaul at chromium.org>

> Reported-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  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 3feef0659940..3e88fa24eab3 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.11.0

-- 
Sean Paul, Software Engineer, Google / Chromium OS


More information about the Intel-gfx mailing list