sctp: add a checking for sctp_sysctl_net_register
When register_net_sysctl failed, we should free the sysctl_table. Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
eb9f37053d
commit
f66138c847
|
@ -447,6 +447,10 @@ int sctp_sysctl_net_register(struct net *net)
|
|||
table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp;
|
||||
|
||||
net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table);
|
||||
if (net->sctp.sysctl_header == NULL) {
|
||||
kfree(table);
|
||||
return -ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue