[<prev] [next>] [day] [month] [year] [list]
Message-ID: <702721b279dd864db1b8ea468136b96075df3994.camel@linux.intel.com>
Date: Wed, 08 Mar 2023 10:12:20 -0800
From: "David E. Box" <david.e.box@...ux.intel.com>
To: Dongliang Mu <dzm91@...t.edu.cn>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>
Cc: platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-next 2/3] drivers/platform/x86/intel: fix a memory
leak in intel_vsec_add_aux
Hi Dongliang,
Thanks for your patch. Do cc the mailing list next time.
Reviewed-by: David E. Box <david.e.box@...ux.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@...t.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;
> }
Powered by blists - more mailing lists