Wang Hai
fa6882c636
tipc: fix memory leak in tipc_topsrv_start()
...
kmemleak report a memory leak as follows:
unreferenced object 0xffff88810a596800 (size 512):
comm "ip", pid 21558, jiffies 4297568990 (age 112.120s)
hex dump (first 32 bytes):
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
ff ff ff ff ff ff ff ff 00 83 60 b0 ff ff ff ff ..........`.....
backtrace:
[<0000000022bbe21f>] tipc_topsrv_init_net+0x1f3/0xa70
[<00000000fe15ddf7>] ops_init+0xa8/0x3c0
[<00000000138af6f2>] setup_net+0x2de/0x7e0
[<000000008c6807a3>] copy_net_ns+0x27d/0x530
[<000000006b21adbd>] create_new_namespaces+0x382/0xa30
[<00000000bb169746>] unshare_nsproxy_namespaces+0xa1/0x1d0
[<00000000fe2e42bc>] ksys_unshare+0x39c/0x780
[<0000000009ba3b19>] __x64_sys_unshare+0x2d/0x40
[<00000000614ad866>] do_syscall_64+0x56/0xa0
[<00000000a1b5ca3c>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
'srv' is malloced in tipc_topsrv_start() but not free before
leaving from the error handling cases. We need to free it.
Fixes: 5c45ab24ac77 ("tipc: make struct tipc_server private for server.c")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Link: https://lore.kernel.org/r/20201109140913.47370-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-11-11 14:39:23 -08:00
..
2020-10-12 10:05:47 +02:00
2020-09-28 00:51:39 -07:00
2020-08-03 15:48:32 -07:00
2020-10-31 12:26:30 -07:00
2020-07-25 17:49:04 -07:00
2020-10-02 19:11:11 -07:00
2020-10-29 17:22:59 -05:00
2020-09-30 08:34:08 -07:00
2020-10-15 12:33:24 -07:00
2020-10-20 13:54:53 +02:00
2020-09-05 15:57:05 -07:00
2020-11-03 22:30:32 +01:00
2020-10-12 15:29:27 +02:00
2020-10-29 12:55:02 -07:00
2020-09-10 15:09:08 -07:00
2020-09-30 14:21:30 -07:00
2020-08-23 17:36:59 -05:00
2020-10-19 17:32:50 -07:00
2020-11-09 17:15:34 -08:00
2020-10-02 19:11:11 -07:00
2020-10-02 19:11:11 -07:00
2020-11-10 17:42:35 -08:00
2020-11-10 17:42:35 -08:00
2020-11-10 18:08:17 -08:00
2020-07-24 15:41:54 -07:00
2020-08-02 01:02:12 -07:00
2020-10-02 19:11:11 -07:00
2020-08-27 07:55:59 -07:00
2020-07-24 15:41:54 -07:00
2020-10-30 10:22:42 +01:00
2020-09-08 20:12:58 -07:00
2020-10-20 21:16:45 -07:00
2020-11-09 17:34:34 -08:00
2020-10-02 19:11:11 -07:00
2020-10-31 11:11:11 +01:00
2020-11-10 15:31:46 -08:00
2020-10-09 20:22:32 -07:00
2020-08-23 17:36:59 -05:00
2020-10-20 17:06:22 -07:00
2020-11-03 16:57:42 -08:00
2020-09-19 16:40:48 -07:00
2020-08-23 17:36:59 -05:00
2020-10-02 19:11:11 -07:00
2020-10-06 06:01:35 -07:00
2020-10-28 09:14:49 -03:00
2020-08-23 17:36:59 -05:00
2020-10-15 13:28:00 +01:00
2020-10-29 11:45:47 -07:00
2020-11-02 15:03:25 -08:00
2020-10-31 14:31:28 -07:00
2020-10-22 09:44:27 -07:00
2020-09-23 17:46:31 -07:00
2020-11-11 14:39:23 -08:00
2020-10-15 12:43:21 -07:00
2020-10-15 18:42:13 -07:00
2020-10-26 16:22:42 -07:00
2020-10-02 19:11:11 -07:00
2020-10-30 10:06:56 +01:00
2020-08-23 17:36:59 -05:00
2020-10-29 15:19:56 +01:00
2020-11-04 08:12:52 -08:00
2020-10-03 00:02:13 -04:00
2020-09-30 18:01:26 -07:00
2020-10-05 18:40:01 -07:00