Skip to content

Commit

Permalink
ipvs: null check of net->ipvs in lblc(r) shedulers
Browse files Browse the repository at this point in the history
Avoid crash when registering shedulers after
the IPVS core initialization for netns fails. Do this by
checking for present core (net->ipvs).

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>
  • Loading branch information
Hans Schillstrom authored and ummakynes committed Apr 30, 2012
1 parent 39f618b commit 4b984cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netfilter/ipvs/ip_vs_lblc.c
Expand Up @@ -551,6 +551,9 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
{
struct netns_ipvs *ipvs = net_ipvs(net);

if (!ipvs)
return -ENOENT;

if (!net_eq(net, &init_net)) {
ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
sizeof(vs_vars_table),
Expand Down
3 changes: 3 additions & 0 deletions net/netfilter/ipvs/ip_vs_lblcr.c
Expand Up @@ -745,6 +745,9 @@ static int __net_init __ip_vs_lblcr_init(struct net *net)
{
struct netns_ipvs *ipvs = net_ipvs(net);

if (!ipvs)
return -ENOENT;

if (!net_eq(net, &init_net)) {
ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
sizeof(vs_vars_table),
Expand Down

0 comments on commit 4b984cd

Please sign in to comment.