mirror of git://git.sysmocom.de/ofono
Change the semantics to return id > max on failure
This commit is contained in:
parent
0ed5c70010
commit
4e621f3ad3
|
@ -146,7 +146,7 @@ unsigned int idmap_alloc(struct idmap *idmap)
|
|||
bit = find_next_zero_bit(idmap->bits, idmap->size, 0);
|
||||
|
||||
if (bit >= idmap->size)
|
||||
return 0;
|
||||
return idmap->max + 1;
|
||||
|
||||
offset = bit / BITS_PER_LONG;
|
||||
idmap->bits[offset] |= 1 << (bit % BITS_PER_LONG);
|
||||
|
|
Loading…
Reference in New Issue