sparc64: restore irq in error paths in iommu
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Nov 2016 21:15:37 +0000 (00:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Dec 2016 02:15:49 +0000 (18:15 -0800)
There are some error paths where we should restore IRQs but we don't.

Fixes: bb620c3d3925 ("sparc: Make sparc64 use scalable lib/iommu-common.c functions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/pci_sun4v.c

index cabb609fedcc9a7ab6b544a5ec7c1be20beaa74b..f4daccd12bf549849d47d04bf048d9500fffcb27 100644 (file)
@@ -242,6 +242,7 @@ static void *dma_4v_alloc_coherent(struct device *dev, size_t size,
        return ret;
 
 iommu_map_fail:
+       local_irq_restore(flags);
        iommu_tbl_range_free(tbl, *dma_addrp, npages, IOMMU_ERROR_CODE);
 
 range_alloc_fail:
@@ -414,6 +415,7 @@ bad:
        return DMA_ERROR_CODE;
 
 iommu_map_fail:
+       local_irq_restore(flags);
        iommu_tbl_range_free(tbl, bus_addr, npages, IOMMU_ERROR_CODE);
        return DMA_ERROR_CODE;
 }