From: Andrei Emeltchenko Date: Wed, 22 Feb 2012 15:11:57 +0000 (+0200) Subject: Bluetooth: Remove socket lock check X-Git-Tag: firefly_0821_release~3680^2~3338^2~112^2~53 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b3fb611ec7b76048cb14600e9a5a9b57e5d913da;p=firefly-linux-kernel-4.4.55.git Bluetooth: Remove socket lock check Simplify code so that we do not need to check whether socket is locked. Signed-off-by: Andrei Emeltchenko Acked-by: Gustavo F. Padovan Signed-off-by: Johan Hedberg --- 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; }