Skip to content

Commit 94911a0

Browse files
LuBaolugregkh
authored andcommitted
iommu/vt-d: Fix a potential memory leak
commit bbe4b3a 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 <[email protected]> Cc: Jacob Pan <[email protected]> Cc: <[email protected]> # v4.4+ Signed-off-by: Lu Baolu <[email protected]> Fixes: 2f26e0a ('iommu/vt-d: Add basic SVM PASID support') Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2413ed8 commit 94911a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iommu/intel-svm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
389389
pasid_max - 1, GFP_KERNEL);
390390
if (ret < 0) {
391391
kfree(svm);
392+
kfree(sdev);
392393
goto out;
393394
}
394395
svm->pasid = ret;

0 commit comments

Comments
 (0)