mirror of https://gerrit.osmocom.org/libosmocore
ns2: Memory allocation failures are ENOMEM, not ENOSPC
ENOSPC is used with non-volatile (disk) storage, while ENOMEM is customarily used for RAM allocation failures. Change-Id: Ia4c16d8278dc30c7cc69169b18428cda5272738d
This commit is contained in:
parent
c3aa8f903a
commit
bdfb8b9104
|
@ -1367,12 +1367,12 @@ int ns2_bind_alloc(struct gprs_ns2_inst *nsi, const char *name,
|
|||
|
||||
bind = talloc_zero(nsi, struct gprs_ns2_vc_bind);
|
||||
if (!bind)
|
||||
return -ENOSPC;
|
||||
return -ENOMEM;
|
||||
|
||||
bind->name = talloc_strdup(bind, name);
|
||||
if (!bind->name) {
|
||||
talloc_free(bind);
|
||||
return -ENOSPC;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
bind->nsi = nsi;
|
||||
|
|
|
@ -738,7 +738,7 @@ int gprs_ns2_fr_bind(struct gprs_ns2_inst *nsi,
|
|||
bind->dump_vty = dump_vty;
|
||||
priv = bind->priv = talloc_zero(bind, struct priv_bind);
|
||||
if (!priv) {
|
||||
rc = -ENOSPC;
|
||||
rc = -ENOMEM;
|
||||
goto err_bind;
|
||||
}
|
||||
|
||||
|
|
|
@ -565,7 +565,7 @@ int gprs_ns2_frgre_bind(struct gprs_ns2_inst *nsi,
|
|||
priv = bind->priv = talloc_zero(bind, struct priv_bind);
|
||||
if (!priv) {
|
||||
gprs_ns2_free_bind(bind);
|
||||
return -ENOSPC;
|
||||
return -ENOMEM;
|
||||
}
|
||||
priv->fd.cb = frgre_fd_cb;
|
||||
priv->fd.data = bind;
|
||||
|
|
|
@ -341,7 +341,7 @@ int gprs_ns2_ip_bind(struct gprs_ns2_inst *nsi,
|
|||
priv = bind->priv = talloc_zero(bind, struct priv_bind);
|
||||
if (!priv) {
|
||||
gprs_ns2_free_bind(bind);
|
||||
return -ENOSPC;
|
||||
return -ENOMEM;
|
||||
}
|
||||
priv->fd.cb = nsip_fd_cb;
|
||||
priv->fd.data = bind;
|
||||
|
|
Loading…
Reference in New Issue