Browse Source

ipvs: add check in ftp for initialized core

	Avoid crash when registering ip_vs_ftp after
the IPVS core initialization for netns fails. Do this by
checking for present core (net->ipvs).

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Julian Anastasov 13 years ago
parent
commit
8d08d71ce5
1 changed files with 2 additions and 0 deletions
  1. 2 0
      net/netfilter/ipvs/ip_vs_ftp.c

+ 2 - 0
net/netfilter/ipvs/ip_vs_ftp.c

@@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
 	struct ip_vs_app *app;
 	struct netns_ipvs *ipvs = net_ipvs(net);
 
+	if (!ipvs)
+		return -ENOENT;
 	app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
 	if (!app)
 		return -ENOMEM;