[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230406113211.648424-2-sashal@kernel.org>
Date: Thu, 6 Apr 2023 07:31:56 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Dongliang Mu <dzm91@...t.edu.cn>,
"David E . Box" <david.e.box@...ux.intel.com>,
Hans de Goede <hdegoede@...hat.com>,
Sasha Levin <sashal@...nel.org>, markgross@...nel.org,
platform-driver-x86@...r.kernel.org
Subject: [PATCH AUTOSEL 6.1 02/17] platform/x86/intel: vsec: Fix a memory leak in intel_vsec_add_aux
From: Dongliang Mu <dzm91@...t.edu.cn>
[ Upstream commit da0ba0ccce54059d6c6b788a75099bfce95126da ]
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.
Reviewed-by: David E. Box <david.e.box@...ux.intel.com>
Signed-off-by: Dongliang Mu <dzm91@...t.edu.cn>
Link: https://lore.kernel.org/r/20230309040107.534716-4-dzm91@hust.edu.cn
Reviewed-by: Hans de Goede <hdegoede@...hat.com>
Signed-off-by: Hans de Goede <hdegoede@...hat.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
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 bb81b8b1f7e9b..483bb65651665 100644
--- a/drivers/platform/x86/intel/vsec.c
+++ b/drivers/platform/x86/intel/vsec.c
@@ -141,6 +141,7 @@ static int intel_vsec_add_aux(struct pci_dev *pdev, struct intel_vsec_device *in
ret = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
if (ret < 0) {
+ kfree(intel_vsec_dev->resource);
kfree(intel_vsec_dev);
return ret;
}
--
2.39.2
Powered by blists - more mailing lists