diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index b7268a14184f220bef244f38bfcc2d13900c443a..f6533e0198f6c67067205fbd1e64fa3fc18a3e05 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -138,7 +138,7 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, break; /* found a free slot */ } adjust_limit_pfn: - limit_pfn = curr_iova->pfn_lo - 1; + limit_pfn = curr_iova->pfn_lo ? (curr_iova->pfn_lo - 1) : 0; move_left: prev = curr; curr = rb_prev(curr);