Commit c51ba246 authored by Robin Murphy's avatar Robin Murphy Committed by Christoph Hellwig
Browse files

swiotlb: fail map correctly with failed io_tlb_default_mem



In the failure case of trying to use a buffer which we'd previously
failed to allocate, the "!mem" condition is no longer sufficient since
io_tlb_default_mem became static and assigned by default. Update the
condition to work as intended per the rest of that conversion.

Fixes: 463e862a ("swiotlb: Convert io_default_tlb_mem to static allocation")
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 4136ce90
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
	int index;
	phys_addr_t tlb_addr;

	if (!mem)
	if (!mem || !mem->nslabs)
		panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer");

	if (cc_platform_has(CC_ATTR_MEM_ENCRYPT))