diff mbox series

[3/4] Klock work Fix for possible memory leak in intel_execlists_submission.c

Message ID 20210628143829.22995-4-krishnaiah.bommu@intel.com (mailing list archive)
State New, archived
Headers show
Series The Following Patches are to Fix the Critical KclockWork Errors in i915_gem and gt | expand

Commit Message

Bommu, Krishnaiah June 28, 2021, 2:38 p.m. UTC
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tvrtko Ursulin June 28, 2021, 3:01 p.m. UTC | #1
On 28/06/2021 15:38, Bommu Krishnaiah wrote:
> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> index cdb2126a159a8..a4673900af0e0 100644
> --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> @@ -3847,6 +3847,7 @@ intel_execlists_create_virtual(struct intel_engine_cs **siblings,
>   
>   err_put:
>   	intel_context_put(&ve->context);
> +	kfree(ve);
>   	return ERR_PTR(err);
>   }
>   
> 
It looks like a false positive to me because it is already freed:

intel_context_put(&ve->context)
   -> rcu_virtual_context_destroy
        -> kfree(ve)

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index cdb2126a159a8..a4673900af0e0 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -3847,6 +3847,7 @@  intel_execlists_create_virtual(struct intel_engine_cs **siblings,
 
 err_put:
 	intel_context_put(&ve->context);
+	kfree(ve);
 	return ERR_PTR(err);
 }