Skip to content

Commit

Permalink
Bluetooth: controller: split: Fix control flow issues
Browse files Browse the repository at this point in the history
This fixes reported Coverity CID 203393 control flow issues.

Fixes zephyrproject-rtos#18381.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
cvinayak authored and carlescufi committed Aug 20, 2019
1 parent 951b47f commit 0746017
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions subsys/bluetooth/controller/ll_sw/ull_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3856,7 +3856,6 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link,
u16_t eff_rx_time;
u16_t eff_tx_time;
#endif /* CONFIG_BT_CTLR_PHY */
u8_t nack = 0U;

/* Check for free ctrl tx PDU */
if (pdu_rx->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_LENGTH_REQ) {
Expand Down Expand Up @@ -4033,21 +4032,20 @@ static inline int length_req_rsp_recv(struct ll_conn *conn, memq_link_t *link,

send_length_resp:
if (tx) {
if (nack) {
mem_release(tx, &mem_conn_tx_ctrl.free);
} else {
/* FIXME: if nack-ing is implemented then release tx instead
* of sending resp.
*/
#if !defined(CONFIG_BT_CTLR_PHY)
length_resp_send(conn, tx, eff_rx_octets,
eff_tx_octets);
length_resp_send(conn, tx, eff_rx_octets,
eff_tx_octets);
#else /* CONFIG_BT_CTLR_PHY */
length_resp_send(conn, tx, eff_rx_octets,
eff_rx_time, eff_tx_octets,
eff_tx_time);
length_resp_send(conn, tx, eff_rx_octets,
eff_rx_time, eff_tx_octets,
eff_tx_time);
#endif /* CONFIG_BT_CTLR_PHY */
}
}

return nack;
return 0;
}
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */

Expand Down

0 comments on commit 0746017

Please sign in to comment.