Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Mesh: Fix tx seg buffer with NULL pointer reference #27251

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions subsys/bluetooth/mesh/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct net_buf_simple *sdu,

BT_DBG("seg %u: %s", seg_o, bt_hex(buf, len));

tx->seg[seg_o] = buf;

if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) {
enum bt_mesh_friend_pdu_type type;

Expand All @@ -552,11 +554,11 @@ static int send_seg(struct bt_mesh_net_tx *net_tx, struct net_buf_simple *sdu,
* out through the Friend Queue.
*/
k_mem_slab_free(&segs, &buf);
continue;
tx->seg[seg_o] = NULL;
}

}

tx->seg[seg_o] = buf;
}

/* This can happen if segments only went into the Friend Queue */
Expand Down