mirror of git://git.sysmocom.de/ofono
gprs: fix error check of gprs_cid_alloc function
When there is no context id available, idmap_alloc and gprs_cid_alloc return max + 1.
This commit is contained in:
parent
69c67fce7f
commit
d43e48ae73
|
@ -313,7 +313,7 @@ static gboolean assign_context(struct pri_context *ctx, int use_cid)
|
|||
} else
|
||||
ctx->context.cid = gprs_cid_alloc(ctx->gprs);
|
||||
|
||||
if (ctx->context.cid == 0)
|
||||
if (ctx->context.cid > idmap_get_max(cidmap))
|
||||
return FALSE;
|
||||
|
||||
for (l = ctx->gprs->context_drivers; l; l = l->next) {
|
||||
|
|
Loading…
Reference in New Issue