diff mbox series

[next] drm/i915: Fix inconsistent IS_ERR and PTR_ERR

Message ID 20200910102120.GA9481@embeddedor (mailing list archive)
State New, archived
Headers show
Series [next] drm/i915: Fix inconsistent IS_ERR and PTR_ERR | expand

Commit Message

Gustavo A. R. Silva Sept. 10, 2020, 10:21 a.m. UTC
Fix inconsistent IS_ERR and PTR_ERR in i915_gem_object_copy_blt().

The proper pointer to be passed as argument to PTR_ERR() is vma[1].

This bug was detected with the help of Coccinelle.

Fixes: 6b05030496f7 ("drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2.")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gustavo A. R. Silva Sept. 25, 2020, 3:35 p.m. UTC | #1
Hi all,

Friendly ping: who can take this?

Thanks
--
Gustavo

On 9/10/20 05:21, Gustavo A. R. Silva wrote:
> Fix inconsistent IS_ERR and PTR_ERR in i915_gem_object_copy_blt().
> 
> The proper pointer to be passed as argument to PTR_ERR() is vma[1].
> 
> This bug was detected with the help of Coccinelle.
> 
> Fixes: 6b05030496f7 ("drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2.")
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c b/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
> index d93eb36160c9..aee7ad3cc3c6 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
> @@ -364,7 +364,7 @@ int i915_gem_object_copy_blt(struct drm_i915_gem_object *src,
>  
>  	vma[1] = i915_vma_instance(dst, vm, NULL);
>  	if (IS_ERR(vma[1]))
> -		return PTR_ERR(vma);
> +		return PTR_ERR(vma[1]);
>  
>  	i915_gem_ww_ctx_init(&ww, true);
>  	intel_engine_pm_get(ce->engine);
>
Chris Wilson Sept. 30, 2020, 11:31 a.m. UTC | #2
Quoting Gustavo A. R. Silva (2020-09-25 16:35:12)
> Hi all,
> 
> Friendly ping: who can take this?

We had picked up the same patch from Dan Carpenter, thanks.

commit 68ba71e3ae6dd86a23486655e33c5f8c9bd90777
Author: Dan Carpenter <dan.carpenter@oracle.com>
Date:   Fri Sep 11 10:52:43 2020 +0300

    drm/i915: Fix an error code i915_gem_object_copy_blt()

-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c b/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
index d93eb36160c9..aee7ad3cc3c6 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
@@ -364,7 +364,7 @@  int i915_gem_object_copy_blt(struct drm_i915_gem_object *src,
 
 	vma[1] = i915_vma_instance(dst, vm, NULL);
 	if (IS_ERR(vma[1]))
-		return PTR_ERR(vma);
+		return PTR_ERR(vma[1]);
 
 	i915_gem_ww_ctx_init(&ww, true);
 	intel_engine_pm_get(ce->engine);