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


The following commit(s) were added to refs/heads/master by this push:
     new 2421a591a5 bluetooth: fixing bt_buf addref/release balance
2421a591a5 is described below

commit 2421a591a53809d472f64711d81f3ce01736e192
Author: Sergey Nikitenko <s.nikite...@me.com>
AuthorDate: Sun Jul 24 01:16:05 2022 +0300

    bluetooth: fixing bt_buf addref/release balance
---
 wireless/bluetooth/bt_hcicore.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c
index 8268f0943b..fa4a7af718 100644
--- a/wireless/bluetooth/bt_hcicore.c
+++ b/wireless/bluetooth/bt_hcicore.c
@@ -1741,15 +1741,6 @@ int bt_hci_cmd_send(uint16_t opcode, FAR struct bt_buf_s 
*buf)
           return -ENOBUFS;
         }
     }
-  else
-    {
-      /* We manage the refcount the same for supplied and created
-       * buffers so increment the supplied count so we can manage
-       * it as-if we created it.
-       */
-
-      bt_buf_addref(buf);
-    }
 
   wlinfo("opcode %04x len %u\n", opcode, buf->len);
 
@@ -1793,10 +1784,6 @@ int bt_hci_cmd_send_sync(uint16_t opcode, FAR struct 
bt_buf_s *buf,
           return -ENOBUFS;
         }
     }
-  else
-    {
-      bt_buf_addref(buf);
-    }
 
   wlinfo("opcode %04x len %u\n", opcode, buf->len);
 
@@ -1861,7 +1848,6 @@ int bt_hci_cmd_send_sync(uint16_t opcode, FAR struct 
bt_buf_s *buf,
       bt_buf_release(buf->u.hci.sync);
     }
 
-  bt_buf_release(buf);
   return ret;
 }
 

Reply via email to