swiotlb: fail map correctly with failed io_tlb_default_mem
authorRobin Murphy <robin.murphy@arm.com>
Tue, 12 Jul 2022 06:46:45 +0000 (08:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:07 +0000 (14:24 +0200)
commit1008e81163e8fadb3b92dce4eee3ea96e3b7dcd7
tree1dda14f15ec648d2063873770e940947b6bdb037
parent80f697b57f572af6198093a05b8e88beb751736c
swiotlb: fail map correctly with failed io_tlb_default_mem

[ Upstream commit c51ba246cb172c9e947dc6fb8868a1eaf0b2a913 ]

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: 463e862ac63e ("swiotlb: Convert io_default_tlb_mem to static allocation")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/dma/swiotlb.c