diff options
| author | Dongliang Mu <[email protected]> | 2023-03-09 04:01:07 +0000 |
|---|---|---|
| committer | Hans de Goede <[email protected]> | 2023-03-20 12:11:55 +0000 |
| commit | da0ba0ccce54059d6c6b788a75099bfce95126da (patch) | |
| tree | 54b3c0ac4f549ea19b372529b7233639f8a7711b /drivers/platform/x86/intel/vsec.c | |
| parent | platform: mellanox: mlx-platform: Initialize shift variable to 0 (diff) | |
| download | kernel-da0ba0ccce54059d6c6b788a75099bfce95126da.tar.gz kernel-da0ba0ccce54059d6c6b788a75099bfce95126da.zip | |
platform/x86/intel: vsec: Fix a memory leak in intel_vsec_add_aux
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 <[email protected]>
Signed-off-by: Dongliang Mu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/vsec.c')
| -rw-r--r-- | drivers/platform/x86/intel/vsec.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |
