diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2008-11-21 16:45:22 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-21 16:45:22 -0800 |
commit | 7e56b5d698707a9934833c47b24d78fb0bcaf764 (patch) | |
tree | 949d9320501fa64e3710acda83487d4c74e52247 /include/net/request_sock.h | |
parent | 33cf71cee14743185305c61625c4544885055733 (diff) |
net: Fix memory leak in the proto_register function
If the slub allocator is used, kmem_cache_create() may merge two or more
kmem_cache's into one but the cache name pointer is not updated and
kmem_cache_name() is no longer guaranteed to return the pointer passed
to the former function. This patch stores the kmalloc'ed pointers in the
corresponding request_sock_ops and timewait_sock_ops structures.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/request_sock.h')
-rw-r--r-- | include/net/request_sock.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index cac811e51f6..c7190846e12 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h @@ -31,6 +31,7 @@ struct request_sock_ops { int family; int obj_size; struct kmem_cache *slab; + char *slab_name; int (*rtx_syn_ack)(struct sock *sk, struct request_sock *req); void (*send_ack)(struct sock *sk, struct sk_buff *skb, |