Bluetooth: L2CAP: Fix checking for STATUS_OUT
The test_and_set_bit() should be checking if the flag was *not* already set, since that's the scenario where we want to call the status callback. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
525889c6b5
commit
847f4e6ae6
1 changed files with 1 additions and 1 deletions
|
@ -786,7 +786,7 @@ static void l2cap_chan_tx_give_credits(struct bt_l2cap_le_chan *chan,
|
|||
k_sem_give(&chan->tx.credits);
|
||||
}
|
||||
|
||||
if (atomic_test_and_set_bit(chan->chan.status, BT_L2CAP_STATUS_OUT) &&
|
||||
if (!atomic_test_and_set_bit(chan->chan.status, BT_L2CAP_STATUS_OUT) &&
|
||||
chan->chan.ops->status) {
|
||||
chan->chan.ops->status(&chan->chan, chan->chan.status);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue