Re: [PATCH 2/2] drm/vmwgfx: Fix uninitialized return in vmw_kms_helper_dirty()

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

 



Reviewed-by: Sinclair Yeh <syeh@xxxxxxxxxx>

On Sat, Sep 19, 2015 at 12:32:24AM +0200, Christian Engelmayer wrote:
> Function vmw_kms_helper_dirty() uses the uninitialized variable ret as
> return value. Make the result deterministic and directly return as the
> variable is unused anyway. Detected by Coverity CID 1324255.
> 
> Signed-off-by: Christian Engelmayer <cengelma@xxxxxx>
> ---
> Compile tested only. Applies against linux-next.
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index 61fb7f3de311..15a6c01cd016 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -1685,7 +1685,6 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
>  	struct drm_crtc *crtc;
>  	u32 num_units = 0;
>  	u32 i, k;
> -	int ret;
>  
>  	dirty->dev_priv = dev_priv;
>  
> @@ -1711,7 +1710,7 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
>  			if (!dirty->cmd) {
>  				DRM_ERROR("Couldn't reserve fifo space "
>  					  "for dirty blits.\n");
> -				return ret;
> +				return -ENOMEM;
>  			}
>  			memset(dirty->cmd, 0, dirty->fifo_reserve_size);
>  		}
> -- 
> 1.9.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux