[PATCH] osmo-bsc[master]: libbsc: nokia_site: Fix uninitialized return val

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

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Mar 26 16:21:20 UTC 2018


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

libbsc: nokia_site: Fix uninitialized return val

Fixes following compilation warning:
bts_nokia_site.c:1248:9: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  return ret;

This could happen if parameter len is passed with value 0.
If we reach the end of the function, it means everything went fine, so
we can return 0 instead of using ret, which is only used to store error
code before returning.

Change-Id: Ic60c8c632a6ddadb8f197d56cc68c2dbfc121d05
---
M src/libbsc/bts_nokia_site.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/7508/1

diff --git a/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c
index 6221e5f..67281bb 100644
--- a/src/libbsc/bts_nokia_site.c
+++ b/src/libbsc/bts_nokia_site.c
@@ -1245,7 +1245,8 @@
 		data += len_to_send;
 		seq++;
 	}
-	return ret;
+
+	return 0;
 }
 
 /* TODO: put in a separate file ? */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic60c8c632a6ddadb8f197d56cc68c2dbfc121d05
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list