summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2012-10-08 11:41:17 +0000
committerDavid S. Miller <davem@davemloft.net>2012-10-08 17:42:35 -0400
commitf8a17175c63fd3e8b573719f7538816f8c96abf4 (patch)
tree5f592b7613c48716dc1a88bfd688129d24e62324 /net/ipv4/fib_semantics.c
parente0adef0f7456d5d3a3bfe8ea61c7dddf146b40e1 (diff)
downloadop-kernel-dev-f8a17175c63fd3e8b573719f7538816f8c96abf4.zip
op-kernel-dev-f8a17175c63fd3e8b573719f7538816f8c96abf4.tar.gz
ipv4: make sure nh_pcpu_rth_output is always allocated
Avoid checking nh_pcpu_rth_output in fast path, abort fib_info creation on alloc_percpu failure. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 2677530..71b125c 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -840,6 +840,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
change_nexthops(fi) {
nexthop_nh->nh_parent = fi;
nexthop_nh->nh_pcpu_rth_output = alloc_percpu(struct rtable __rcu *);
+ if (!nexthop_nh->nh_pcpu_rth_output)
+ goto failure;
} endfor_nexthops(fi)
if (cfg->fc_mx) {
OpenPOWER on IntegriCloud