Change in libosmocore[master]: ns2: Memory allocation failures are ENOMEM, not ENOSPC

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Feb 1 09:17:04 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22567 )

Change subject: ns2: Memory allocation failures are ENOMEM, not ENOSPC
......................................................................

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
---
M src/gb/gprs_ns2.c
M src/gb/gprs_ns2_fr.c
M src/gb/gprs_ns2_frgre.c
M src/gb/gprs_ns2_udp.c
4 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 4f3bc5e..2dde693 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -1367,12 +1367,12 @@
 
 	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 953f4ca..c32bce8 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -738,7 +738,7 @@
 	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 863f8f2..88ef037 100644
--- a/src/gb/gprs_ns2_frgre.c
+++ b/src/gb/gprs_ns2_frgre.c
@@ -565,7 +565,7 @@
 	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 b4bcd01..9277f9a 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -341,7 +341,7 @@
 	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;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22567
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia4c16d8278dc30c7cc69169b18428cda5272738d
Gerrit-Change-Number: 22567
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210201/63f673c4/attachment.htm>


More information about the gerrit-log mailing list