Bluetooth: ATT: Fix not releasing buffer before calling the callback
The cloned buffer is used to retry in case a security error happen but since the buffer pool is now limited the callback may actually block if it creates a new request which would need 2 buffers (original + clone) but only one is available since the previous request clone is not released yet. Change-Id: Ife508b09c4b326b8213fd0b130ebf3c2e7fe47c9 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
b85593fb09
commit
bb27219ecb
1 changed files with 6 additions and 0 deletions
|
@ -190,6 +190,12 @@ static uint8_t att_handle_rsp(struct bt_att *att, void *pdu, uint16_t len,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Release cloned buffer */
|
||||
if (att->req.buf) {
|
||||
net_buf_unref(att->req.buf);
|
||||
att->req.buf = NULL;
|
||||
}
|
||||
|
||||
/* Reset request before callback so another request can be queued */
|
||||
memcpy(&req, &att->req, sizeof(req));
|
||||
att->req.func = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue