You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/07/30 03:45:20 UTC

[incubator-nuttx] 01/02: stm32wb/mbox: fixing txbuf queue

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 49af13c507a2f91e4dbf32a8a1638a3c10da3d87
Author: Sergey Nikitenko <s....@me.com>
AuthorDate: Fri Jul 29 22:48:52 2022 +0300

    stm32wb/mbox: fixing txbuf queue
---
 arch/arm/src/stm32wb/stm32wb_mbox.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/src/stm32wb/stm32wb_mbox.c b/arch/arm/src/stm32wb/stm32wb_mbox.c
index f3bed170a4..ac11d14a87 100644
--- a/arch/arm/src/stm32wb/stm32wb_mbox.c
+++ b/arch/arm/src/stm32wb/stm32wb_mbox.c
@@ -512,13 +512,13 @@ static bool stm32wb_mbox_txnext(struct stm32wb_mbox_channel_s *chan)
 
       if (chan->ch_num == STM32WB_MBOX_BLEACL_CHANNEL)
         {
-          memcpy(chan->msg_buf, &pkt_buf->acl_hdr,
-                 pkt_buf->acl_hdr.len);
+          memcpy(&chan->msg_buf->acl_hdr, &pkt_buf->acl_hdr,
+                 sizeof(pkt_buf->acl_hdr) + pkt_buf->acl_hdr.len);
         }
       else
         {
-          memcpy(chan->msg_buf, &pkt_buf->cmd_hdr,
-                 pkt_buf->cmd_hdr.param_len);
+          memcpy(&chan->msg_buf->cmd_hdr, &pkt_buf->cmd_hdr,
+                 sizeof(pkt_buf->cmd_hdr) + pkt_buf->cmd_hdr.param_len);
         }
 
       /* Start transmission */