提交 5a57faef 编写于 作者: C Claire Chang 提交者: Zheng Zengkai

swiotlb: Fix the type of index

stable inclusion
from stable-5.10.38
commit a01572e21f0941a1c8b7d39369fec3bd9b7e5e85
bugzilla: 51875
CVE: NA

--------------------------------

[ Upstream commit 95b079d8 ]

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

Fixes: 26a7e094 ("swiotlb: refactor swiotlb_tbl_map_single")
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NClaire Chang <tientzu@chromium.org>
Signed-off-by: NKonrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 7d326935
......@@ -563,7 +563,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册