summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-07-08 11:16:16 +0100
committerDavid S. Miller <davem@davemloft.net>2017-07-08 11:16:16 +0100
commit5dc314f8ded18e2b0ffce55a5f253c8aa759d51a (patch)
tree606445d216e1fb481b1d6e8d5f1fb264d41fa4f9 /include
parent9dc351da7503b568fb877ad02688b29ad95c32af (diff)
parent0ffdaf5b41cf4435ece14d1d3e977ce69012a20d (diff)
Merge branch 'rds-tcp-sock_graft-leak'
Sowmini Varadhan says: ==================== rds-tcp: sock_graft() leak Following up on the discussion at https://www.spinics.net/lists/netdev/msg442859.html - make rds_tcp_accept_one() call sock_create_lite() - add a WARN_ON() to sock_graft() Tested by running an infinite while() loop that does (module-load; rds-stress; module-unload) and monitors TCP slabinfo while the test is running. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 48e4d5c38f85..8c85791fc196 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1697,6 +1697,7 @@ static inline void sock_orphan(struct sock *sk)
static inline void sock_graft(struct sock *sk, struct socket *parent)
{
+ WARN_ON(parent->sk);
write_lock_bh(&sk->sk_callback_lock);
sk->sk_wq = parent->wq;
parent->sk = sk;