summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 19:27:23 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 19:27:23 +0100
commit960f58af407960ebf310281f72826c91e52e20c9 (patch)
tree1eaaf2e52dc8a5006f37ce99911f5b7d3be0433e
parent2182e884045b55c98b0945f98d99cfcff73b6c4d (diff)
Work fix gcc maybe-uninitialized warnings/errors
-rw-r--r--openbsc/src/libbsc/bsc_init.c2
-rw-r--r--openbsc/src/libbsc/bsc_vty.c8
-rw-r--r--openbsc/src/libbsc/bts_nokia_site.c2
-rw-r--r--openbsc/src/libcommon/gsup_test_client.c8
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c2
5 files changed, 14 insertions, 8 deletions
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 36531d2d8..33bc40fbe 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -101,7 +101,7 @@ int bsc_shutdown_net(struct gsm_network *net)
static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len)
{
struct gsm_bts *bts = trx->bts;
- int rc, j;
+ int rc = 0, j;
if (si_len) {
DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i),
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 3daa262c4..044801f3e 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -1276,10 +1276,10 @@ static int lchan_summary(struct vty *vty, int argc, const char **argv,
void (*dump_cb)(struct vty *, struct gsm_lchan *))
{
struct gsm_network *net = gsmnet_from_vty(vty);
- struct gsm_bts *bts;
- struct gsm_bts_trx *trx;
- struct gsm_bts_trx_ts *ts;
- struct gsm_lchan *lchan;
+ struct gsm_bts *bts = NULL;
+ struct gsm_bts_trx *trx = NULL;
+ struct gsm_bts_trx_ts *ts = NULL;
+ struct gsm_lchan *lchan = NULL;
int bts_nr, trx_nr, ts_nr, lchan_nr;
if (argc >= 1) {
diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/openbsc/src/libbsc/bts_nokia_site.c
index 3ca76c017..848264d67 100644
--- a/openbsc/src/libbsc/bts_nokia_site.c
+++ b/openbsc/src/libbsc/bts_nokia_site.c
@@ -1156,7 +1156,7 @@ static int abis_nm_send_multi_segments(struct gsm_bts *bts, uint8_t msg_type,
{
int len_remain, len_to_send, max_send;
int seq = 0;
- int ret;
+ int ret = 0;
len_remain = len;
diff --git a/openbsc/src/libcommon/gsup_test_client.c b/openbsc/src/libcommon/gsup_test_client.c
index 8fc38d60d..e1823c622 100644
--- a/openbsc/src/libcommon/gsup_test_client.c
+++ b/openbsc/src/libcommon/gsup_test_client.c
@@ -198,7 +198,7 @@ static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type)
static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg)
{
struct osmo_gsup_message gsup_msg = {0};
- struct imsi_op *io;
+ struct imsi_op *io = NULL;
int rc;
DEBUGP(DGPRS, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
@@ -227,7 +227,13 @@ static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg)
break;
}
+ if (!io) {
+ printf("Could not find imsi_op\n");
+ return -1;
+ }
+
imsi_op_rx_gsup(io, &gsup_msg);
+
msgb_free(msg);
return 0;
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 9d19025cf..428380e36 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -193,7 +193,7 @@ int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq,
struct gsm_subscriber *subscr = conn->subscr;
struct gsm_security_operation *op;
struct gsm_auth_tuple atuple;
- int status = -1, rc;
+ int status = -1, rc = -1;
/* Check if we _can_ enable encryption. Cases where we can't:
* - Encryption disabled in config