Skip to content

Commit

Permalink
ipvs: add check in ftp for initialized core
Browse files Browse the repository at this point in the history
	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 <[email protected]>
Acked-by: Hans Schillstrom <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
Julian Anastasov authored and horms committed Apr 26, 2012
1 parent 8f9b9a2 commit 8d08d71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/ipvs/ip_vs_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d08d71

Please sign in to comment.