diff options
author | Julian Anastasov <ja@ssi.bg> | 2012-04-24 17:29:59 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2012-04-26 02:26:35 -0400 |
commit | 8d08d71ce59438a6ef06be5db07966e0c144b74e (patch) | |
tree | 804e30b7bd516ff39f6f6656fc760ea8db993ead /net | |
parent | 8f9b9a2fad47af27e14b037395e03cd8278d96d7 (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ftp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 538d74ee4f68..e39f693dd3e4 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
@@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net) | |||
439 | struct ip_vs_app *app; | 439 | struct ip_vs_app *app; |
440 | struct netns_ipvs *ipvs = net_ipvs(net); | 440 | struct netns_ipvs *ipvs = net_ipvs(net); |
441 | 441 | ||
442 | if (!ipvs) | ||
443 | return -ENOENT; | ||
442 | app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL); | 444 | app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL); |
443 | if (!app) | 445 | if (!app) |
444 | return -ENOMEM; | 446 | return -ENOMEM; |