dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/guc: Correctly free guc capture struct on error
@ 2022-03-24  0:04 Daniele Ceraolo Spurio
  2022-03-24  9:35 ` [Intel-gfx] " Das, Nirmoy
  0 siblings, 1 reply; 2+ messages in thread
From: Daniele Ceraolo Spurio @ 2022-03-24  0:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: John Harrison, Daniele Ceraolo Spurio, Alan Previn, dri-devel

On error the "new" allocation is not freed, so add the required kfree.

Fixes: 247f8071d5893 ("drm/i915/guc: Pre-allocate output nodes for extraction")
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: John Harrison <john.c.harrison@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
index afdcbe63e9eb1..c4e25966d3e9f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
@@ -1040,6 +1040,7 @@ guc_capture_alloc_one_node(struct intel_guc *guc)
 		if (!new->reginfo[i].regs) {
 			while (i)
 				kfree(new->reginfo[--i].regs);
+			kfree(new);
 			return NULL;
 		}
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/guc: Correctly free guc capture struct on error
  2022-03-24  0:04 [PATCH] drm/i915/guc: Correctly free guc capture struct on error Daniele Ceraolo Spurio
@ 2022-03-24  9:35 ` Das, Nirmoy
  0 siblings, 0 replies; 2+ messages in thread
From: Das, Nirmoy @ 2022-03-24  9:35 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx; +Cc: dri-devel, Alan Previn

Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>

On 3/24/2022 1:04 AM, Daniele Ceraolo Spurio wrote:
> On error the "new" allocation is not freed, so add the required kfree.
>
> Fixes: 247f8071d5893 ("drm/i915/guc: Pre-allocate output nodes for extraction")
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
> Cc: John Harrison <john.c.harrison@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
> index afdcbe63e9eb1..c4e25966d3e9f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
> @@ -1040,6 +1040,7 @@ guc_capture_alloc_one_node(struct intel_guc *guc)
>   		if (!new->reginfo[i].regs) {
>   			while (i)
>   				kfree(new->reginfo[--i].regs);
> +			kfree(new);
>   			return NULL;
>   		}
>   	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-24  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24  0:04 [PATCH] drm/i915/guc: Correctly free guc capture struct on error Daniele Ceraolo Spurio
2022-03-24  9:35 ` [Intel-gfx] " Das, Nirmoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).