summaryrefslogtreecommitdiffstats
path: root/net/rds/tcp.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2010-11-02 02:54:01 +0100
committerDavid S. Miller <davem@davemloft.net>2010-11-04 02:50:07 +0100
commit8200a59f24aeca379660f80658a8c0c343ca5c31 (patch)
treefc21336c6dd33ee96d7cf9f07f20132d4a46994e /net/rds/tcp.c
parentrds: Lost locking in loop connection freeing (diff)
downloadlinux-8200a59f24aeca379660f80658a8c0c343ca5c31.tar.xz
linux-8200a59f24aeca379660f80658a8c0c343ca5c31.zip
rds: Remove kfreed tcp conn from list
All the rds_tcp_connection objects are stored list, but when being freed it should be removed from there. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp.c')
-rw-r--r--net/rds/tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 08a8c6cf2d10..8e0a32001c90 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -221,7 +221,13 @@ static int rds_tcp_conn_alloc(struct rds_connection *conn, gfp_t gfp)
static void rds_tcp_conn_free(void *arg)
{
struct rds_tcp_connection *tc = arg;
+ unsigned long flags;
rdsdebug("freeing tc %p\n", tc);
+
+ spin_lock_irqsave(&rds_tcp_conn_lock, flags);
+ list_del(&tc->t_tcp_node);
+ spin_unlock_irqrestore(&rds_tcp_conn_lock, flags);
+
kmem_cache_free(rds_tcp_conn_slab, tc);
}