bluetooth: fixing bt_buf addref/release balance

This commit is contained in:
Sergey Nikitenko 2022-07-24 01:16:05 +03:00 committed by Xiang Xiao
parent 7fa3ecde5a
commit 2421a591a5
1 changed files with 0 additions and 14 deletions

View File

@ -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;
}