Skip to content
Commit 01dc4e1a authored by Jonathan Rico's avatar Jonathan Rico Committed by Anas Nashif
Browse files

Bluetooth: hci_common: Add assert on `buf` allocation



`net_buf_alloc(K_FOREVER)` can now return NULL if running in the system
workqueue. `bt_hci_evt_create()` is called in that context in a few cases.

Since we can't really do anything about it, add a (default-on) assert.

This should ideally never fail. I saw it fail because of a leak in the ACL
buffer pool, which is also shared with events when host flow control is not
enabled.

In that particular case, the host is rendered non-functional, so trying to
recover using error handling is futile.

Signed-off-by: default avatarJonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 5a4fdfbf)
parent fb270828
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment