Change in libosmocore[master]: gprs_ns2_vty_create: remove bind pointer check

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

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Oct 6 22:51:04 UTC 2020


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/20467 )


Change subject: gprs_ns2_vty_create: remove bind pointer check
......................................................................

gprs_ns2_vty_create: remove bind pointer check

The bind pointer can't be NULL because gprs_ns2_ip_bind()
is either return 0 and bind is valid or != 0 and returning.

Found-by: Coverity
Fixes: CID#214854
Change-Id: I11d86c9cb36226701e51942f14d7a6412c3eff26
---
M src/gb/gprs_ns2_vty.c
1 file changed, 8 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/20467/1

diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index 01eb534..c6c4b02 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -810,17 +810,15 @@
 		}
 		nse->persistent = true;
 
-		if (bind) {
-			nsvc = gprs_ns2_ip_connect(bind,
-						   &sockaddr,
-						   nse,
-						   vtyvc->nsvci);
-			if (!nsvc) {
-				/* Could not create NSVC, connect failed */
-				continue;
-			}
-			nsvc->persistent = true;
+		nsvc = gprs_ns2_ip_connect(bind,
+					   &sockaddr,
+					   nse,
+					   vtyvc->nsvci);
+		if (!nsvc) {
+			/* Could not create NSVC, connect failed */
+			continue;
 		}
+		nsvc->persistent = true;
 	}
 
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I11d86c9cb36226701e51942f14d7a6412c3eff26
Gerrit-Change-Number: 20467
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201006/0fa2c78c/attachment.htm>


More information about the gerrit-log mailing list