Re: [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes

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

 



On Tue, Mar 24, 2015 at 03:46:20PM +0000, Michel Thierry wrote:
> i915_dma_map_single relies on dma_mapping_error, which returns positive
> error codes. Found by static checker.
> 
> Introduced by commit 678d96fbb3b5995a2fdff2bca5e1ab4a40b7e968
> ("drm/i915: Track GEN6 page table usage").
> 

Please give me reporter credit so I can justify my paycheck to my boss.

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

> Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
> Signed-off-by: Michel Thierry <michel.thierry@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 645c363..79ade6f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -348,7 +348,7 @@ static struct i915_page_table_entry *alloc_pt_single(struct drm_device *dev)
>  		goto fail_page;
>  
>  	ret = i915_dma_map_single(pt, dev);
> -	if (ret)
> +	if (ret != 0)

Heh.  What is this?  :P  You just added a double negative.  Just change
to return negative error codes on failure.

regards,
dan carpenter

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





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