summaryrefslogtreecommitdiffstats
path: root/net/core/request_sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-15 21:12:16 -0700
committerDavid S. Miller <davem@davemloft.net>2015-03-16 15:55:29 -0400
commit13854e5a60461daee08ce99842b7f4d37553d911 (patch)
treef7bf7650ead7d8af1e93d98114da5cd1bf658956 /net/core/request_sock.c
parent2c13270b441054a9596bcd99c0f446603c9ad131 (diff)
downloadblackbird-op-linux-13854e5a60461daee08ce99842b7f4d37553d911.tar.gz
blackbird-op-linux-13854e5a60461daee08ce99842b7f4d37553d911.zip
inet: add proper refcounting to request sock
reqsk_put() is the generic function that should be used to release a refcount (and automatically call reqsk_free()) reqsk_free() might be called if refcount is known to be 0 or undefined. refcnt is set to one in inet_csk_reqsk_queue_add() As request socks are not yet in global ehash table, I added temporary debugging checks in reqsk_put() and reqsk_free() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/request_sock.c')
-rw-r--r--net/core/request_sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index 04db318e6218..e910317ef6d9 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -103,7 +103,7 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
while ((req = lopt->syn_table[i]) != NULL) {
lopt->syn_table[i] = req->dl_next;
lopt->qlen--;
- reqsk_free(req);
+ reqsk_put(req);
}
}
}
@@ -180,7 +180,7 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
*/
spin_unlock_bh(&fastopenq->lock);
sock_put(lsk);
- reqsk_free(req);
+ reqsk_put(req);
return;
}
/* Wait for 60secs before removing a req that has triggered RST.
OpenPOWER on IntegriCloud