Skip to contentSkip to conversation

Bluetooth: L2CAP: Fix a condition in l2cap_sock_recvmsg()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: L2CAP: Fix a condition in l2cap_sock_recvmsg()

Smatch complains about the indenting:

net/bluetooth/l2cap_sock.c:1027 l2cap_sock_recvmsg()
warn: inconsistent indenting

It looks like this is supposed to be an "else if" condition.

Fixes 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
---
 net/bluetooth/l2cap_sock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/l2cap_sock.c +1 -1
index 0c636be3469e..40fb10b591bd 100644
@@ -1024,7 +1024,7 @@ static int l2cap_sock_recvmsg(struct socket *sock, struct msghdr *msg,
 			sk->sk_state = BT_CONNECTED;
 			pi->chan->state = BT_CONNECTED;
 			__l2cap_ecred_conn_rsp_defer(pi->chan);
-		} if (bdaddr_type_is_le(pi->chan->src_type)) {
+		} else if (bdaddr_type_is_le(pi->chan->src_type)) {
 			sk->sk_state = BT_CONNECTED;
 			pi->chan->state = BT_CONNECTED;
 			__l2cap_le_connect_rsp_defer(pi->chan);
Signature · 1 line
2.20.1
maintainer
#1 lore raw

Hi Dan,

Quoted 5 lines

Smatch complains about the indenting:

net/bluetooth/l2cap_sock.c:1027 l2cap_sock_recvmsg()
warn: inconsistent indenting

Quoted 7 lines

It looks like this is supposed to be an "else if" condition.

Fixes 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")

---
net/bluetooth/l2cap_sock.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel