From 1bbb31e2019fe82603228ecbcb78092761ac31a8 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 17 Nov 2016 20:32:53 +0200 Subject: [PATCH] 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 --- subsys/bluetooth/host/l2cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/l2cap.c b/subsys/bluetooth/host/l2cap.c index 6e449fd911f..41840c90ed4 100644 --- a/subsys/bluetooth/host/l2cap.c +++ b/subsys/bluetooth/host/l2cap.c @@ -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;