1
0
Fork 0
alistair23-linux/net/dccp
Wang Hai 05e275d874 dccp: Fix possible memleak in dccp_init and dccp_fini
[ Upstream commit c96b6acc8f ]

There are some memory leaks in dccp_init() and dccp_fini().

In dccp_fini() and the error handling path in dccp_init(), free lhash2
is missing. Add inet_hashinfo2_free_mod() to do it.

If inet_hashinfo2_init_mod() failed in dccp_init(),
percpu_counter_destroy() should be called to destroy dccp_orphan_count.
It need to goto out_free_percpu when inet_hashinfo2_init_mod() failed.

Fixes: c92c81df93 ("net: dccp: fix kernel crash on module load")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-17 16:40:32 +02:00
..
ccids
Kconfig
Makefile
ackvec.c
ackvec.h
ccid.c
ccid.h
dccp.h
diag.c
feat.c
feat.h
input.c
ipv4.c
ipv6.c
ipv6.h
minisocks.c
options.c
output.c
proto.c dccp: Fix possible memleak in dccp_init and dccp_fini 2020-06-17 16:40:32 +02:00
qpolicy.c
sysctl.c
timer.c
trace.h