From: João Paulo Rechi Vita <jprvita@profusion.mobi>
Date: Tue, 22 Jun 2010 16:56:22 +0000 (-0300)
Subject: Bluetooth: Fix l2cap_sock_connect error return.
X-Git-Tag: firefly_0821_release~9833^2~1306^2~64^2~48^2~26
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8b0dc6dc827fb71efd6c9dfb5c4172b7b5c96cee;p=firefly-linux-kernel-4.4.55.git

Bluetooth: Fix l2cap_sock_connect error return.

Return a proper error value if socket is already connected.

Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 6b839d682143..e322be8ff948 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1158,6 +1158,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
 
 	case BT_CONNECTED:
 		/* Already connected */
+		err = -EISCONN;
 		goto done;
 
 	case BT_OPEN: