aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-01-14 11:21:09 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2021-01-14 11:26:15 +0100
commit84c3e8649a2ccdb367aa07a27f0be20fc7932cf6 (patch)
tree94ab521280f57a2f66ce349684b4ac3de8c5b93b /src
parent634fd81f3deaa6b708178dbfebe0f3f8afc1952f (diff)
tests/hnb-test: Fix uninitialized use of rc variable
Diffstat (limited to 'src')
-rw-r--r--src/tests/hnb-test.c7
1 files 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)