Skip to content

Commit

Permalink
iommu/amd: Drop pasid_state reference in ppr_notifer error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Jul 10, 2014
1 parent 61feb43 commit dc88db7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/iommu/amd_iommu_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dc88db7

Please sign in to comment.