Commit 7a566173 authored by Colin Ian King's avatar Colin Ian King Committed by Joerg Roedel

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: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210204150001.102672-1-colin.king@canonical.com
Addresses-Coverity: ("Unsigned comparison against 0")
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent b8437a3e
......@@ -645,7 +645,7 @@ static void mtk_iommu_get_resv_regions(struct device *dev,
struct iommu_resv_region *region;
int prot = IOMMU_WRITE | IOMMU_READ;
if (domid < 0)
if ((int)domid < 0)
return;
curdom = data->plat_data->iova_region + domid;
for (i = 0; i < data->plat_data->iova_region_nr; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment