[Intel-gfx] [PATCH 2/5] drm/i915: i915_dma_map_single returns positive error codes

Dan Carpenter dan.carpenter at oracle.com
Tue Mar 24 08:57:13 PDT 2015


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 at oracle.com>

> Cc: Dan Carpenter <dan.carpenter at oracle.com>
> Cc: Mika Kuoppala <mika.kuoppala at intel.com>
> Signed-off-by: Michel Thierry <michel.thierry at intel.com>
> ---
>  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



More information about the Intel-gfx mailing list