Bluetooth: L2CAP: Fix regression with move to k_sem API

k_sem_take return differ from nano_sem_take since it return 0 for
successful case instead of 1.

Change-Id: Ia39cd624d56dbc1c8e7f3558244bebf765da191d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-11-17 20:32:53 +02:00 committed by Johan Hedberg
commit 1bbb31e201

View file

@ -1251,7 +1251,7 @@ static void l2cap_chan_le_recv(struct bt_l2cap_le_chan *chan,
{
uint16_t sdu_len;
if (!k_sem_take(&chan->rx.credits, K_NO_WAIT)) {
if (k_sem_take(&chan->rx.credits, K_NO_WAIT)) {
BT_ERR("No credits to receive packet");
bt_l2cap_chan_disconnect(&chan->chan);
return;