Skip to content

Commit 9c4a856

Browse files
lib/: find_new_sub_[ug]ids(): Remove redundant checks
find_free_range() already checks this, and does it better. Signed-off-by: Alejandro Colomar <alx@kernel.org>
1 parent 3f0338c commit 9c4a856

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

lib/find_new_sub_gids.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ int find_new_sub_gids (id_t *range_start, unsigned long *range_count)
3434
max = getdef_ulong ("SUB_GID_MAX", 600100000UL);
3535
count = getdef_ulong ("SUB_GID_COUNT", 65536);
3636

37-
if (min > max || count >= max || (min + count - 1) > max) {
38-
errno = ERANGE;
39-
return -1;
40-
}
41-
4237
start = sub_gid_find_free_range(min, max, count);
4338
if (start == -1)
4439
return -1;

lib/find_new_sub_uids.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ int find_new_sub_uids (id_t *range_start, unsigned long *range_count)
3434
max = getdef_ulong ("SUB_UID_MAX", 600100000UL);
3535
count = getdef_ulong ("SUB_UID_COUNT", 65536);
3636

37-
if (min > max || count >= max || (min + count - 1) > max) {
38-
errno = ERANGE;
39-
return -1;
40-
}
41-
4237
start = sub_uid_find_free_range(min, max, count);
4338
if (start == -1)
4439
return -1;

0 commit comments

Comments
 (0)