From 2421a591a53809d472f64711d81f3ce01736e192 Mon Sep 17 00:00:00 2001 From: Sergey Nikitenko Date: Sun, 24 Jul 2022 01:16:05 +0300 Subject: [PATCH] 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; }