Skip to content

Commit 95b079d

Browse files
Claire Changkonradwilk
authored andcommitted
swiotlb: Fix the type of index
Fix the type of index from unsigned int to int since find_slots() might return -1. Fixes: 26a7e09 ("swiotlb: refactor swiotlb_tbl_map_single") Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Claire Chang <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent 2726bf3 commit 95b079d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/dma/swiotlb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
499499
{
500500
struct io_tlb_mem *mem = io_tlb_default_mem;
501501
unsigned int offset = swiotlb_align_offset(dev, orig_addr);
502-
unsigned int index, i;
502+
unsigned int i;
503+
int index;
503504
phys_addr_t tlb_addr;
504505

505506
if (!mem)

0 commit comments

Comments
 (0)