Fix several Coverity found issues
Closes: CID#242770 Closes: CID#242769 Closes: CID#242767 Change-Id: I6d73a970919889953539fbacc601d679d7ec4113
This commit is contained in:
parent
a7dc04ef26
commit
ecc76ef69a
|
@ -45,14 +45,15 @@ static int hnb_gtp_cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len
|
||||||
{
|
{
|
||||||
struct hnb_gtp_prim *gtp_prim;
|
struct hnb_gtp_prim *gtp_prim;
|
||||||
struct hnb_ue *ue = lib->priv;
|
struct hnb_ue *ue = lib->priv;
|
||||||
struct hnb *hnb = ue->hnb;
|
struct hnb *hnb;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (!ue || !ue->conn_ps.active) {
|
if (!ue || !ue->conn_ps.active) {
|
||||||
LOGUE(ue, DGTP, LOGL_NOTICE, "Tx GTP-CONN_DATA.ind data=%p len=%u but UE conn_ps is not active!\n",
|
LOGP(DGTP, LOGL_NOTICE, "Tx GTP-CONN_DATA.ind data=%p len=%u but UE conn_ps is not active!\n",
|
||||||
packet, len);
|
packet, len);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
hnb = ue->hnb;
|
||||||
|
|
||||||
LOGUE(ue, DGTP, LOGL_DEBUG, "Tx GTP-CONN_DATA.ind data=%p len=%u\n", packet, len);
|
LOGUE(ue, DGTP, LOGL_DEBUG, "Tx GTP-CONN_DATA.ind data=%p len=%u\n", packet, len);
|
||||||
gtp_prim = hnb_gtp_makeprim_conn_data_ind(ue->conn_id, ue->conn_ps.local_tei, packet, len);
|
gtp_prim = hnb_gtp_makeprim_conn_data_ind(ue->conn_id, ue->conn_ps.local_tei, packet, len);
|
||||||
|
@ -180,18 +181,19 @@ int hnb_ue_gtp_bind(struct hnb_ue *ue, const struct osmo_sockaddr *rem_addr, uin
|
||||||
int hnb_ue_gtp_tx(struct hnb_ue *ue, void *gtpu_payload, unsigned gtpu_payload_len)
|
int hnb_ue_gtp_tx(struct hnb_ue *ue, void *gtpu_payload, unsigned gtpu_payload_len)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
struct hnb *hnb = ue->hnb;
|
struct hnb *hnb;
|
||||||
|
|
||||||
if (!hnb->gtp.gsn) {
|
|
||||||
LOGUE(ue, DGTP, LOGL_ERROR, "Tx: GTP socket not bound\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ue || !ue->conn_ps.pdp_lib) {
|
if (!ue || !ue->conn_ps.pdp_lib) {
|
||||||
LOGUE(ue, DGTP, LOGL_ERROR, "Tx: UE PDP Ctx not available\n");
|
LOGUE(ue, DGTP, LOGL_ERROR, "Tx: UE PDP Ctx not available\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hnb = ue->hnb;
|
||||||
|
if (!hnb->gtp.gsn) {
|
||||||
|
LOGUE(ue, DGTP, LOGL_ERROR, "Tx: GTP socket not bound\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
rc = gtp_data_req(hnb->gtp.gsn, ue->conn_ps.pdp_lib, gtpu_payload, gtpu_payload_len);
|
rc = gtp_data_req(hnb->gtp.gsn, ue->conn_ps.pdp_lib, gtpu_payload, gtpu_payload_len);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,7 @@ static int hnb_rua_rx_initiating(struct hnb *hnb, RUA_InitiatingMessage_t *init)
|
||||||
case RUA_ProcedureCode_id_DirectTransfer:
|
case RUA_ProcedureCode_id_DirectTransfer:
|
||||||
LOGP(DRUA, LOGL_INFO, "RUA rx Initiating DirectTransfer\n");
|
LOGP(DRUA, LOGL_INFO, "RUA rx Initiating DirectTransfer\n");
|
||||||
hnb_rua_dt_handle(hnb, &init->value);
|
hnb_rua_dt_handle(hnb, &init->value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LOGP(DRUA, LOGL_INFO, "RUA rx unknown Initiating message\n");
|
LOGP(DRUA, LOGL_INFO, "RUA rx unknown Initiating message\n");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue