diff options
author | Hans Schillstrom <hans.schillstrom@ericsson.com> | 2012-04-26 09:45:35 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-04-30 10:40:35 +0200 |
commit | 582b8e3eadaec77788c1aa188081a8d5059c42a6 (patch) | |
tree | 57f869aac66f51e56499c06027c7d1055285600b /net/netfilter/ipvs/ip_vs_proto.c | |
parent | 4b984cd50bc1b6d492175cd77bfabb78e76ffa67 (diff) | |
download | op-kernel-dev-582b8e3eadaec77788c1aa188081a8d5059c42a6.zip op-kernel-dev-582b8e3eadaec77788c1aa188081a8d5059c42a6.tar.gz |
ipvs: take care of return value from protocol init_netns
ip_vs_create_timeout_table() can return NULL
All functions protocol init_netns is affected of this patch.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_proto.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index a62360e..ed835e6 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c @@ -78,8 +78,15 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp) ipvs->proto_data_table[hash] = pd; atomic_set(&pd->appcnt, 0); /* Init app counter */ - if (pp->init_netns != NULL) - pp->init_netns(net, pd); + if (pp->init_netns != NULL) { + int ret = pp->init_netns(net, pd); + if (ret) { + /* unlink an free proto data */ + ipvs->proto_data_table[hash] = pd->next; + kfree(pd); + return ret; + } + } return 0; } |