Skip to content

Commit 7a56617

Browse files
Colin Ian Kingjoergroedel
authored andcommitted
iommu/mediatek: Fix unsigned domid comparison with less than zero
Currently the check for domid < 0 is always false because domid is unsigned. Fix this by casting domid to an int before making the comparison. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Addresses-Coverity: ("Unsigned comparison against 0") Signed-off-by: Joerg Roedel <[email protected]>
1 parent b8437a3 commit 7a56617

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static void mtk_iommu_get_resv_regions(struct device *dev,
645645
struct iommu_resv_region *region;
646646
int prot = IOMMU_WRITE | IOMMU_READ;
647647

648-
if (domid < 0)
648+
if ((int)domid < 0)
649649
return;
650650
curdom = data->plat_data->iova_region + domid;
651651
for (i = 0; i < data->plat_data->iova_region_nr; i++) {

0 commit comments

Comments
 (0)