[SRU][PATCH 07/13] swiotlb: Fix the type of index
Khalid Elmously
khalid.elmously at canonical.com
Thu Oct 7 18:06:38 UTC 2021
From: Claire Chang <tientzu at chromium.org>
BugLink: https://bugs.launchpad.net/bugs/1943902
Fix the type of index from unsigned int to int since find_slots() might
return -1.
Fixes: 26a7e094783d ("swiotlb: refactor swiotlb_tbl_map_single")
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Claire Chang <tientzu at chromium.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad at kernel.org>
(cherry picked from commit 95b079d8215b83b37fa59341fda92fcb9392f14a)
Signed-off-by: Khalid Elmously <khalid.elmously at canonical.com>
---
kernel/dma/swiotlb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 5a0d9d4864aca..5ae6c51f9ecbe 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -546,7 +546,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *dev, dma_addr_t dma_addr,
enum dma_data_direction dir,
unsigned long attrs)
{
- unsigned int index, i;
+ unsigned int i;
+ int index;
phys_addr_t tlb_addr;
if (no_iotlb_memory)
--
2.17.1
More information about the kernel-team
mailing list