Skip to content

Commit

Permalink
swiotlb: Fix the type of index
Browse files Browse the repository at this point in the history
[ Upstream commit 95b079d ]

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 <hch@lst.de>
Signed-off-by: Claire Chang <tientzu@chromium.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Claire Chang authored and gregkh committed May 19, 2021
1 parent 38ccbba commit 569bb35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/dma/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, phys_addr_t orig_addr,
enum dma_data_direction dir, unsigned long attrs)
{
unsigned int offset = swiotlb_align_offset(dev, orig_addr);
unsigned int index, i;
unsigned int i;
int index;
phys_addr_t tlb_addr;

if (no_iotlb_memory)
Expand Down

0 comments on commit 569bb35

Please sign in to comment.