Skip to content

Commit 69611f7

Browse files
committed
mesh/transport: fix unreachable os_mbuf_free_chain in bt_mesh_ctl_send
1 parent cf20b6d commit 69611f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nimble/host/mesh/src/transport.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ static inline int32_t ack_timeout(struct seg_rx *rx)
994994
int bt_mesh_ctl_send(struct bt_mesh_net_tx *tx, uint8_t ctl_op, void *data,
995995
size_t data_len, const struct bt_mesh_send_cb *cb, void *cb_data)
996996
{
997+
int err;
997998
struct os_mbuf *buf = NET_BUF_SIMPLE(data_len);
998999

9991000
net_buf_simple_init_with_data(buf, data, data_len);
@@ -1022,11 +1023,12 @@ int bt_mesh_ctl_send(struct bt_mesh_net_tx *tx, uint8_t ctl_op, void *data,
10221023
BT_DBG("len %zu: %s", data_len, bt_hex(data, data_len));
10231024

10241025
if (tx->ctx->send_rel) {
1025-
return send_seg(tx, buf, cb, cb_data, &ctl_op);
1026+
err = send_seg(tx, buf, cb, cb_data, &ctl_op);
10261027
} else {
1027-
return send_unseg(tx, buf, cb, cb_data, &ctl_op);
1028+
err = send_unseg(tx, buf, cb, cb_data, &ctl_op);
10281029
}
10291030
os_mbuf_free_chain(buf);
1031+
return err;
10301032
}
10311033

10321034
static int send_ack(struct bt_mesh_subnet *sub, uint16_t src, uint16_t dst,

0 commit comments

Comments
 (0)