drm/i915/gem: Fix error path to unlock if the GEM context is closed
diff mbox series

Message ID 20191106144155.25727-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • drm/i915/gem: Fix error path to unlock if the GEM context is closed
Related show

Commit Message

Chris Wilson Nov. 6, 2019, 2:41 p.m. UTC
When inside the lock, remember to unlock even if you want to leave
early.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: a4e7ccdac38e ("drm/i915: Move context management under GEM")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tvrtko Ursulin Nov. 6, 2019, 3:42 p.m. UTC | #1
On 06/11/2019 14:41, Chris Wilson wrote:
> When inside the lock, remember to unlock even if you want to leave
> early.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: a4e7ccdac38e ("drm/i915: Move context management under GEM")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index a06cc8e63281..774d71b1ea9b 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -1168,7 +1168,7 @@ static int set_ppgtt(struct drm_i915_file_private *file_priv,
>   
>   	if (i915_gem_context_is_closed(ctx)) {
>   		err = -ENOENT;
> -		goto out;
> +		goto unlock;
>   	}
>   
>   	if (vm == rcu_access_pointer(ctx->vm))
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index a06cc8e63281..774d71b1ea9b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -1168,7 +1168,7 @@  static int set_ppgtt(struct drm_i915_file_private *file_priv,
 
 	if (i915_gem_context_is_closed(ctx)) {
 		err = -ENOENT;
-		goto out;
+		goto unlock;
 	}
 
 	if (vm == rcu_access_pointer(ctx->vm))