summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-02-22 19:11:57 +0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-23 15:07:02 +0400
commitb3fb611ec7b76048cb14600e9a5a9b57e5d913da (patch)
treea95447000d733686ff915dcd58d650140541f252 /net/bluetooth
parent6be3655552ee49aa2b5fd20fa1b08f28d0feac86 (diff)
downloadlinux-b3fb611ec7b76048cb14600e9a5a9b57e5d913da.tar.xz
Bluetooth: Remove socket lock check
Simplify code so that we do not need to check whether socket is locked. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_sock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 73a06c1b0cd7..52c94c765779 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -125,15 +125,15 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
err = l2cap_chan_connect(chan, la.l2_psm, la.l2_cid, &la.l2_bdaddr);
if (err)
- goto done;
+ return err;
lock_sock(sk);
err = bt_sock_wait_state(sk, BT_CONNECTED,
sock_sndtimeo(sk, flags & O_NONBLOCK));
-done:
- if (sock_owned_by_user(sk))
- release_sock(sk);
+
+ release_sock(sk);
+
return err;
}