summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2018-02-24 13:42:27 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-24 09:32:08 +0200
commita7e67521c4f2074a8a2d21dd5bd3fb01d86c4d6f (patch)
treef3b9e8df2e59a9a86f595a767f9479ffdf16cfa0 /drivers/iommu
parent4cc90ae05e9b0520edef9aa756edb400bef6838e (diff)
downloadlinux-stable-a7e67521c4f2074a8a2d21dd5bd3fb01d86c4d6f.tar.gz
linux-stable-a7e67521c4f2074a8a2d21dd5bd3fb01d86c4d6f.tar.bz2
linux-stable-a7e67521c4f2074a8a2d21dd5bd3fb01d86c4d6f.zip
iommu/vt-d: Fix a potential memory leak
commit bbe4b3af9d9e3172fb9aa1f8dcdfaedcb381fc64 upstream. A memory block was allocated in intel_svm_bind_mm() but never freed in a failure path. This patch fixes this by free it to avoid memory leakage. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.4+ Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Fixes: 2f26e0a9c9860 ('iommu/vt-d: Add basic SVM PASID support') Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/intel-svm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
index a7d516f973dd..10068a481e22 100644
--- a/drivers/iommu/intel-svm.c
+++ b/drivers/iommu/intel-svm.c
@@ -389,6 +389,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
pasid_max - 1, GFP_KERNEL);
if (ret < 0) {
kfree(svm);
+ kfree(sdev);
goto out;
}
svm->pasid = ret;