sock: struct proto hash function may error
[cascardo/linux.git] / include / net / sock.h
index f5ea148..255d3e0 100644 (file)
@@ -984,7 +984,7 @@ struct proto {
        void            (*release_cb)(struct sock *sk);
 
        /* Keeping track of sk's, looking them up, and port selection methods. */
-       void                    (*hash)(struct sock *sk);
+       int                     (*hash)(struct sock *sk);
        void                    (*unhash)(struct sock *sk);
        void                    (*rehash)(struct sock *sk);
        int                     (*get_port)(struct sock *sk, unsigned short snum);
@@ -1194,10 +1194,10 @@ static inline void sock_prot_inuse_add(struct net *net, struct proto *prot,
 /* With per-bucket locks this operation is not-atomic, so that
  * this version is not worse.
  */
-static inline void __sk_prot_rehash(struct sock *sk)
+static inline int __sk_prot_rehash(struct sock *sk)
 {
        sk->sk_prot->unhash(sk);
-       sk->sk_prot->hash(sk);
+       return sk->sk_prot->hash(sk);
 }
 
 void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);