[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1399553702-7960-3-git-send-email-wangweidong1@huawei.com>
Date: Thu, 8 May 2014 20:55:02 +0800
From: Wang Weidong <wangweidong1@...wei.com>
To: <davem@...emloft.net>, <vyasevich@...il.com>,
<nhorman@...driver.com>, <dborkman@...hat.com>
CC: <linux-sctp@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: [net-next 2/2] 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@...wei.com>
---
net/sctp/sysctl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index ee80eb4..7e5eb75 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -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;
}
--
1.7.12
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists