Commit 847f4e6a authored by Johan Hedberg's avatar Johan Hedberg Committed by Johan Hedberg
Browse files

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 525889c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
	}