Skip to content

Commit

Permalink
mgmt/mcumgr: Fixing use of k_fifo function on net buf
Browse files Browse the repository at this point in the history
Fixing problem where k_fifo functions have been used to get/put
data from/info net buf, where documentation has been strictly
forbidding so.

Found, reported and solution suggested by jrhees-cae.

Fixes: zephyrproject-rtos#32579

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
  • Loading branch information
de-nordic committed Mar 29, 2021
1 parent 4c88abc commit 02e5c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/mgmt/mcumgr/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ zephyr_smp_handle_reqs(struct k_work *work)

zst = (void *)work;

while ((nb = k_fifo_get(&zst->zst_fifo, K_NO_WAIT)) != NULL) {
while ((nb = net_buf_get(&zst->zst_fifo, K_NO_WAIT)) != NULL) {
zephyr_smp_process_packet(zst, nb);
}
}
Expand All @@ -299,6 +299,6 @@ zephyr_smp_transport_init(struct zephyr_smp_transport *zst,
void
zephyr_smp_rx_req(struct zephyr_smp_transport *zst, struct net_buf *nb)
{
k_fifo_put(&zst->zst_fifo, nb);
net_buf_put(&zst->zst_fifo, nb);
k_work_submit(&zst->zst_work);
}

0 comments on commit 02e5c10

Please sign in to comment.