bluetooth: fixing bt_buf addref/release balance
This commit is contained in:
parent
7fa3ecde5a
commit
2421a591a5
@ -1741,15 +1741,6 @@ int bt_hci_cmd_send(uint16_t opcode, FAR struct bt_buf_s *buf)
|
|||||||
return -ENOBUFS;
|
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);
|
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;
|
return -ENOBUFS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
bt_buf_addref(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
wlinfo("opcode %04x len %u\n", opcode, buf->len);
|
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->u.hci.sync);
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_buf_release(buf);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user