diff options
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/iova.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index ea04a88c673d..ff59d8aa3041 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -402,10 +402,14 @@ EXPORT_SYMBOL_GPL(__free_iova); void free_iova(struct iova_domain *iovad, unsigned long pfn) { - struct iova *iova = find_iova(iovad, pfn); + unsigned long flags; + struct iova *iova; + spin_lock_irqsave(&iovad->iova_rbtree_lock, flags); + iova = private_find_iova(iovad, pfn); if (iova) - __free_iova(iovad, iova); + private_free_iova(iovad, iova); + spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); } EXPORT_SYMBOL_GPL(free_iova); |