aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-01-31 11:44:57 +0100
committerHarald Welte <laforge@osmocom.org>2021-02-01 09:39:29 +0100
commitbdfb8b9104fde2a053f86953ecbbdb1b2f265b9d (patch)
tree0fb01a9fabc8627961d9c2b1b5e367f5b586bdcf /src
parentc3aa8f903a58db8af5c2687a3c040fe9f49474fb (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_ns2.c4
-rw-r--r--src/gb/gprs_ns2_fr.c2
-rw-r--r--src/gb/gprs_ns2_frgre.c2
-rw-r--r--src/gb/gprs_ns2_udp.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 4f3bc5e5..2dde6938 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -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;
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 953f4cad..c32bce87 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -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;
}
diff --git a/src/gb/gprs_ns2_frgre.c b/src/gb/gprs_ns2_frgre.c
index 863f8f21..88ef0371 100644
--- a/src/gb/gprs_ns2_frgre.c
+++ b/src/gb/gprs_ns2_frgre.c
@@ -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;
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index b4bcd018..9277f9aa 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -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;