Bluetooth: host: Fix net buf assert on att encrypt change event

Fix assert in net_buf triggered on att encrypt change event.

	ASSERTION FAIL [net_buf_simple_headroom(buf) >= len] @
	  ZEPHYR_BASE/subsys/net/buf.c:881

This happens because when the att request was allocated, it was not
properly initialized and req->retrying was left as true.
This caused the att encrypt change handling to assume an att request
needed to be resent, starting resending with an invalid request and
request buffer.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-01-23 15:42:55 +01:00 committed by Johan Hedberg
commit bf33338652

View file

@ -2268,9 +2268,7 @@ struct bt_att_req *bt_att_req_alloc(s32_t timeout)
BT_DBG("req %p", req);
req->func = NULL;
req->destroy = NULL;
req->user_data = NULL;
memset(req, 0, sizeof(*req));
return req;
}