iommu/vt-d: Fix a potential memory leak
Subsystems (2)
PATCH 1/1 iommu/vt-d: Fix a potential memory leak
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 <[email protected]>
Cc Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/[email protected]>
Cc <[email protected]> # v4.4+
--- drivers/iommu/intel-svm.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/intel-svm.c +1 -0
@@ -396,6 +396,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;
Signature · 1 line
2.7.4
Quoted 4 lines · On Sat, 24 Feb 2018 13:42:27 +0800 Lu Baolu…
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.
looks good to me.
Thanks,
Quoted 13 lines
Cc Ashok Raj <[email protected]>Cc Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/[email protected]>Cc <[email protected]> # v4.4+--- drivers/iommu/intel-svm.c | 1 + 1 file changed, 1 insertion(+)drivers/iommu/intel-svm.c +0
-0
drivers/iommu/intel-svm.c int intel_svm_bind_mm(struct device *dev, int · line 402
Quoted 7 lines
drivers/iommu/intel-svm.c +1
-0@@ -396,6 +396,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;
[Jacob Pan]
Quoted 8 lines · Lu Baolu
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 <[email protected]>Cc Jacob Pan <[email protected]>Cc <[email protected]> # v4.4+Signed-off-by Lu Baolu <[email protected]>
Applied, thanks.