tests/hnb-test: Fix uninitialized use of rc variable
Change-Id: I168e4f7cd48cbaa387e6b05868107250795a0f0c
This commit is contained in:
parent
634fd81f3d
commit
84c3e8649a
|
@ -478,7 +478,7 @@ int hnb_test_hnbap_rx(struct hnb_test *hnb, struct msgb *msg)
|
||||||
msg->data, msgb_length(msg), 0, 0);
|
msg->data, msgb_length(msg), 0, 0);
|
||||||
if (dec_ret.code != RC_OK) {
|
if (dec_ret.code != RC_OK) {
|
||||||
LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");
|
LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");
|
||||||
return rc;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdu->present != HNBAP_PDU_PR_successfulOutcome) {
|
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;
|
RUA_RUA_PDU_t _pdu, *pdu = &_pdu;
|
||||||
asn_dec_rval_t dec_ret;
|
asn_dec_rval_t dec_ret;
|
||||||
int rc;
|
|
||||||
|
|
||||||
memset(pdu, 0, sizeof(*pdu));
|
memset(pdu, 0, sizeof(*pdu));
|
||||||
dec_ret = aper_decode(NULL, &asn_DEF_RUA_RUA_PDU, (void **) &pdu,
|
dec_ret = aper_decode(NULL, &asn_DEF_RUA_RUA_PDU, (void **) &pdu,
|
||||||
msg->data, msgb_length(msg), 0, 0);
|
msg->data, msgb_length(msg), 0, 0);
|
||||||
if (dec_ret.code != RC_OK) {
|
if (dec_ret.code != RC_OK) {
|
||||||
LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");
|
LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");
|
||||||
return rc;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pdu->present) {
|
switch (pdu->present) {
|
||||||
|
@ -560,7 +559,7 @@ int hnb_test_rua_rx(struct hnb_test *hnb, struct msgb *msg)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hnb_read_cb(struct osmo_fd *fd)
|
static int hnb_read_cb(struct osmo_fd *fd)
|
||||||
|
|
Loading…
Reference in New Issue