[MERGED] 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
Tue Mar 27 08:14:20 UTC 2018


Pau Espin Pedrol has submitted this change and it was merged.

Change subject: libbsc: nokia_site: Fix uninitialized return val
......................................................................


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(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: Ic60c8c632a6ddadb8f197d56cc68c2dbfc121d05
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list