Commit f66138c8471442c24c58cdce6ba5f36c5ce93d7a
Committed by
David S. Miller
1 parent
eb9f37053d
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>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
net/sctp/sysctl.c
... | ... | @@ -447,6 +447,10 @@ |
447 | 447 | table[i].data += (char *)(&net->sctp) - (char *)&init_net.sctp; |
448 | 448 | |
449 | 449 | net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table); |
450 | + if (net->sctp.sysctl_header == NULL) { | |
451 | + kfree(table); | |
452 | + return -ENOMEM; | |
453 | + } | |
450 | 454 | return 0; |
451 | 455 | } |
452 | 456 |