This is a note to let you know that I've just added the patch titled platform/x86/intel: vsec: Fix a memory leak in intel_vsec_add_aux to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: platform-x86-intel-vsec-fix-a-memory-leak-in-intel_v.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 2701574fc76331668eb62b6c1a95b4530f4888f9 Author: Dongliang Mu <dzm91@xxxxxxxxxxx> Date: Thu Mar 9 12:01:07 2023 +0800 platform/x86/intel: vsec: Fix a memory leak in intel_vsec_add_aux [ 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@xxxxxxxxxxxxxxx> Signed-off-by: Dongliang Mu <dzm91@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20230309040107.534716-4-dzm91@xxxxxxxxxxx Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> 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; }