Showing error 1084

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: net/bluetooth/rfcomm/sock.c
Line in file: 122
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

 92
 93        bh_lock_sock(sk);
 94
 95        if (err)
 96                sk->sk_err = err;
 97
 98        sk->sk_state = d->state;
 99
100        parent = bt_sk(sk)->parent;
101        if (parent) {
102                if (d->state == BT_CLOSED) {
103                        sock_set_flag(sk, SOCK_ZAPPED);
104                        bt_accept_unlink(sk);
105                }
106                parent->sk_data_ready(parent, 0);
107        } else {
108                if (d->state == BT_CONNECTED)
109                        rfcomm_session_getaddr(d->session, &bt_sk(sk)->src, NULL);
110                sk->sk_state_change(sk);
111        }
112
113        bh_unlock_sock(sk);
114
115        if (parent && sock_flag(sk, SOCK_ZAPPED)) {
116                /* We have to drop DLC lock here, otherwise
117                 * rfcomm_sock_destruct() will dead lock. */
118                rfcomm_dlc_unlock(d);
119                rfcomm_sock_kill(sk);
120                rfcomm_dlc_lock(d);
121        }
122}
123
124/* ---- Socket functions ---- */
125static struct sock *__rfcomm_get_sock_by_addr(u8 channel, bdaddr_t *src)
126{
127        struct sock *sk = NULL;
128        struct hlist_node *node;
129
130        sk_for_each(sk, node, &rfcomm_sk_list.head) {
131                if (rfcomm_pi(sk)->channel == channel &&
132                                !bacmp(&bt_sk(sk)->src, src))
Show full sources