From 84c3e8649a2ccdb367aa07a27f0be20fc7932cf6 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 14 Jan 2021 11:21:09 +0100 Subject: tests/hnb-test: Fix uninitialized use of rc variable Change-Id: I168e4f7cd48cbaa387e6b05868107250795a0f0c --- src/tests/hnb-test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tests/hnb-test.c b/src/tests/hnb-test.c index 4696e80..4650a90 100644 --- a/src/tests/hnb-test.c +++ b/src/tests/hnb-test.c @@ -478,7 +478,7 @@ int hnb_test_hnbap_rx(struct hnb_test *hnb, struct msgb *msg) msg->data, msgb_length(msg), 0, 0); if (dec_ret.code != RC_OK) { LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n"); - return rc; + return -EINVAL; } if (pdu->present != HNBAP_PDU_PR_successfulOutcome) { @@ -506,14 +506,13 @@ int hnb_test_rua_rx(struct hnb_test *hnb, struct msgb *msg) { RUA_RUA_PDU_t _pdu, *pdu = &_pdu; asn_dec_rval_t dec_ret; - int rc; memset(pdu, 0, sizeof(*pdu)); dec_ret = aper_decode(NULL, &asn_DEF_RUA_RUA_PDU, (void **) &pdu, msg->data, msgb_length(msg), 0, 0); if (dec_ret.code != RC_OK) { LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n"); - return rc; + return -EINVAL; } switch (pdu->present) { @@ -560,7 +559,7 @@ int hnb_test_rua_rx(struct hnb_test *hnb, struct msgb *msg) break; } - return rc; + return 0; } static int hnb_read_cb(struct osmo_fd *fd) -- cgit v1.2.3