1
0
Fork 0

swiotlb: Fix the type of index

Fix the type of index from unsigned int to int since find_slots() might
return -1.

Fixes: 26a7e09478 ("swiotlb: refactor swiotlb_tbl_map_single")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Claire Chang <tientzu@chromium.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
pull/352/head
Claire Chang 2021-04-22 16:14:53 +08:00 committed by Konrad Rzeszutek Wilk
parent 2726bf3ff2
commit 95b079d821
1 changed files with 2 additions and 1 deletions

View File

@ -499,7 +499,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
{
struct io_tlb_mem *mem = io_tlb_default_mem;
unsigned int offset = swiotlb_align_offset(dev, orig_addr);
unsigned int index, i;
unsigned int i;
int index;
phys_addr_t tlb_addr;
if (!mem)