Bluetooth: ATT: Fix ATT_CHAN() macro
ATT_CHAN() macro as a wrapper to CONTAINER_OF is been used by ATT internals API wherein the main parameter is pointer to bt_l2cap_chan object. The macro returns pointer to bt_att context object but CONTAINER_OF's third parameter determines what member is taken into account in getting right address. Luckily here this third parameter "chan" of type bt_l2cap_le_chan got of its own sub-member the "chan" of type bt_l2cap_chan on first position in structure order. If such order would change somehow there could be taken wrong address. Change-Id: I955c2af11e001dac90a1eacc281ff167ceb34fb9 Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
parent
f1a82f8ebe
commit
fdfc92c80d
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@
|
|||
#define BT_DBG(fmt, ...)
|
||||
#endif
|
||||
|
||||
#define ATT_CHAN(_ch) CONTAINER_OF(_ch, struct bt_att, chan)
|
||||
#define ATT_CHAN(_ch) CONTAINER_OF(_ch, struct bt_att, chan.chan)
|
||||
|
||||
#define BT_GATT_PERM_READ_MASK (BT_GATT_PERM_READ | \
|
||||
BT_GATT_PERM_READ_ENCRYPT | \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue