Bluetooth: ATT: Assert if request is invalid
Consider invalid if the request pointer is NULL or the callback is NULL or there is a request ongoing. This conditions would likely lead to a crash and most likely there is some other bug involved like for example the application queueing the same request multiple times. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
4e8e0748e8
commit
3fdedde967
1 changed files with 4 additions and 0 deletions
|
@ -262,6 +262,10 @@ static inline bool att_is_connected(struct bt_att *att)
|
|||
|
||||
static int att_send_req(struct bt_att *att, struct bt_att_req *req)
|
||||
{
|
||||
__ASSERT_NO_MSG(req);
|
||||
__ASSERT_NO_MSG(req->func);
|
||||
__ASSERT_NO_MSG(!att->req);
|
||||
|
||||
BT_DBG("req %p", req);
|
||||
|
||||
att->req = req;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue