Avoid false positive for static scan (integer overflow).

Avoid adding signed type to unsigned one.
This commit is contained in:
Milan Broz
2025-05-21 10:56:52 +02:00
parent 8440e59b7b
commit c4ce270568

View File

@@ -1427,7 +1427,8 @@ static int reencrypt_add_single_token_keyslots(struct crypt_device *cd,
if (r < 0)
return r;
count += r;
if (r > 0)
count++;
}
return count;
@@ -1450,7 +1451,8 @@ static int reencrypt_add_token_keyslots_for_unlock(struct crypt_device *cd,
if (r < 0)
return r;
count += r;
if (r > 0)
count++;
}
return count;