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:
Johan Hedberg 2019-12-18 23:58:39 +02:00 committed by Johan Hedberg
commit 847f4e6ae6

View file

@ -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);
}