Showing error 1048

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/sctp/socket.c
Line in file: 5689
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

5659        /* In either case (hit or miss), make sure fastreuse is 1 only
5660         * if sk->sk_reuse is too (that is, if the caller requested
5661         * SO_REUSEADDR on this socket -sk-).
5662         */
5663        if (hlist_empty(&pp->owner)) {
5664                if (sk->sk_reuse && sk->sk_state != SCTP_SS_LISTENING)
5665                        pp->fastreuse = 1;
5666                else
5667                        pp->fastreuse = 0;
5668        } else if (pp->fastreuse &&
5669                (!sk->sk_reuse || sk->sk_state == SCTP_SS_LISTENING))
5670                pp->fastreuse = 0;
5671
5672        /* We are set, so fill up all the data in the hash table
5673         * entry, tie the socket list information with the rest of the
5674         * sockets FIXME: Blurry, NPI (ipg).
5675         */
5676success:
5677        if (!sctp_sk(sk)->bind_hash) {
5678                inet_sk(sk)->num = snum;
5679                sk_add_bind_node(sk, &pp->owner);
5680                sctp_sk(sk)->bind_hash = pp;
5681        }
5682        ret = 0;
5683
5684fail_unlock:
5685        sctp_spin_unlock(&head->lock);
5686
5687fail:
5688        sctp_local_bh_enable();
5689        return ret;
5690}
5691
5692/* Assign a 'snum' port to the socket.  If snum == 0, an ephemeral
5693 * port is requested.
5694 */
5695static int sctp_get_port(struct sock *sk, unsigned short snum)
5696{
5697        long ret;
5698        union sctp_addr addr;
5699        struct sctp_af *af = sctp_sk(sk)->pf->af;
Show full sources