* Re: [PATCH linux-next 2/3] drivers/platform/x86/intel: fix a memory leak in intel_vsec_add_aux
[not found] ` <20230308135538.479223-2-dzm91@hust.edu.cn>
@ 2023-03-08 18:12 ` David E. Box
0 siblings, 0 replies; only message in thread
From: David E. Box @ 2023-03-08 18:12 UTC (permalink / raw)
To: Dongliang Mu, Hans de Goede, Mark Gross; +Cc: platform-driver-x86, linux-kernel
Hi Dongliang,
Thanks for your patch. Do cc the mailing list next time.
Reviewed-by: David E. Box <david.e.box@linux.intel.com>
On Wed, 2023-03-08 at 21:55 +0800, Dongliang Mu wrote:
> The first error handling code in intel_vsec_add_aux misses the
> deallocation of intel_vsec_dev->resource.
>
> Fix this by adding kfree(intel_vsec_dev->resource) in the error handling
> code.
>
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
> drivers/platform/x86/intel/vsec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/platform/x86/intel/vsec.c
> b/drivers/platform/x86/intel/vsec.c
> index 13decf36c6de..2311c16cb975 100644
> --- a/drivers/platform/x86/intel/vsec.c
> +++ b/drivers/platform/x86/intel/vsec.c
> @@ -154,6 +154,7 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device
> *parent,
> ret = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
> mutex_unlock(&vsec_ida_lock);
> if (ret < 0) {
> + kfree(intel_vsec_dev->resource);
> kfree(intel_vsec_dev);
> return ret;
> }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-08 18:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230308135538.479223-1-dzm91@hust.edu.cn>
[not found] ` <20230308135538.479223-2-dzm91@hust.edu.cn>
2023-03-08 18:12 ` [PATCH linux-next 2/3] drivers/platform/x86/intel: fix a memory leak in intel_vsec_add_aux David E. Box
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®