Bluetooth: ATT: Fix bogus CONTAINER_OF() usage

This CONTAINER_OF() worked by chance, but was actually wrong, since it
makes it look like bt_l2cap_le_chan is the parent container of bt_att.
Instead bt_l2cap_le_chan is simply a member of bt_att, i.e. we can
dereference it directly.

Change-Id: I7307517bae823e54b45db31f75462655ce6eb50d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-04-20 14:49:30 +03:00 committed by Luiz Augusto von Dentz
commit ea9a067a9a

View file

@ -1921,8 +1921,7 @@ static void att_reset(struct bt_att *att)
static void att_timeout(struct k_work *work)
{
struct bt_att *att = CONTAINER_OF(work, struct bt_att, timeout_work);
struct bt_l2cap_le_chan *ch =
CONTAINER_OF(att, struct bt_l2cap_le_chan, chan);
struct bt_l2cap_le_chan *ch = &att->chan;
BT_ERR("ATT Timeout");