[PATCH] osmo-msc[master]: gtphob: check for missing result of rate_ctr_group_alloc()

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Aug 24 17:41:00 UTC 2017


Review at  https://gerrit.osmocom.org/3625

gtphob: check for missing result of rate_ctr_group_alloc()

In case the counter group allocation fails, we must handle this
gracefully and fail the allocation of the parent object, too.

The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems
to have missed one instance, so let's follow-up.

Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c
Related: OS#2361
---
M src/gprs/gtphub.c
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/25/3625/1

diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c
index 211018b..5e7520e 100644
--- a/src/gprs/gtphub.c
+++ b/src/gprs/gtphub.c
@@ -2708,6 +2708,10 @@
 
 	pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx,
 					       &gtphub_ctrg_io_desc, 0);
+	if (!pp->counters_io) {
+		talloc_free(pp);
+		return NULL;
+	}
 
 	llist_add(&pp->entry, &a->ports);
 

-- 
To view, visit https://gerrit.osmocom.org/3625
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list