Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d08d71c authored by Julian Anastasov's avatar Julian Anastasov Committed by Simon Horman
Browse files

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: default avatarJulian Anastasov <ja@ssi.bg>
Acked-by: default avatarHans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 8f9b9a2f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;