diff options
author | Joerg Roedel <jroedel@suse.de> | 2014-07-08 16:55:10 +0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-07-10 17:36:40 +0400 |
commit | dc88db7ee9f9a0a850dcee5738031f888ba124b7 (patch) | |
tree | e8b5a6997b737e38c3a0f95f7728ca9dd5eb5d2e /drivers/iommu | |
parent | 61feb43897ec1cf8b126689035b249f30b0d90ad (diff) | |
download | linux-dc88db7ee9f9a0a850dcee5738031f888ba124b7.tar.xz |
iommu/amd: Drop pasid_state reference in ppr_notifer error path
In case we are not able to allocate a fault structure a
reference to the pasid_state will be leaked. Fix that by
dropping the reference in the error path in case we hold
one.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Oded Gabbay <Oded.Gabbay@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index 574c71bdfcfa..6ba707b998ff 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c @@ -607,6 +607,10 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data) ret = NOTIFY_OK; out_drop_state: + + if (ret != NOTIFY_OK && pasid_state) + put_pasid_state(pasid_state); + put_device_state(dev_state); out: |