提交 5ae6acf1 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net/smc: fix a memory leak in smc_sysctl_net_exit()

Recently added smc_sysctl_net_exit() forgot to free
the memory allocated from smc_sysctl_net_init()
for non initial network namespace.

Fixes: 462791bb ("net/smc: add sysctl interface for SMC")
Signed-off-by: NEric Dumazet <edumazet@google.com>
Reported-by: Nsyzbot <syzkaller@googlegroups.com>
Cc: Tony Lu <tonylu@linux.alibaba.com>
Cc: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5c7e49be
......@@ -61,5 +61,10 @@ int __net_init smc_sysctl_net_init(struct net *net)
void __net_exit smc_sysctl_net_exit(struct net *net)
{
struct ctl_table *table;
table = net->smc.smc_hdr->ctl_table_arg;
unregister_net_sysctl_table(net->smc.smc_hdr);
if (!net_eq(net, &init_net))
kfree(table);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册