From e8c4b3f65300a705a4a5540a225f1b2bc3e7f4cd Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Tue, 25 Sep 2012 15:17:07 +0000 Subject: [PATCH] --- yaml --- r: 328135 b: refs/heads/master c: 188c517a050ec5b123e72cab76ea213721e5bd9d h: refs/heads/master i: 328133: 681c8b8569e1d358e82289c24d7746372303f0d5 328131: b38b76c31b4f43f0195130ef10c37b4726b8f3a1 328127: 63a960d2b48f480b359964cfcb340d269dac93bf v: v3 --- [refs] | 2 +- trunk/net/ipv6/ip6_fib.c | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 9bde73daa553..87c381087e30 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 24cad1b4ce9e9da6ec22cfc9361bbbe0ba4f80cc +refs/heads/master: 188c517a050ec5b123e72cab76ea213721e5bd9d diff --git a/trunk/net/ipv6/ip6_fib.c b/trunk/net/ipv6/ip6_fib.c index 286acfc21250..24995a93ef8c 100644 --- a/trunk/net/ipv6/ip6_fib.c +++ b/trunk/net/ipv6/ip6_fib.c @@ -514,7 +514,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, ln = node_alloc(); if (!ln) - return NULL; + return ERR_PTR(-ENOMEM); ln->fn_bit = plen; ln->parent = pn; @@ -561,7 +561,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, node_free(in); if (ln) node_free(ln); - return NULL; + return ERR_PTR(-ENOMEM); } /* @@ -611,7 +611,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, ln = node_alloc(); if (!ln) - return NULL; + return ERR_PTR(-ENOMEM); ln->fn_bit = plen; @@ -777,11 +777,8 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) if (IS_ERR(fn)) { err = PTR_ERR(fn); - fn = NULL; - } - - if (!fn) goto out; + } pn = fn; @@ -820,15 +817,12 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) allow_create, replace_required); if (IS_ERR(sn)) { - err = PTR_ERR(sn); - sn = NULL; - } - if (!sn) { /* If it is failed, discard just allocated root, and then (in st_failure) stale node in main tree. */ node_free(sfn); + err = PTR_ERR(sn); goto st_failure; } @@ -843,10 +837,8 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) if (IS_ERR(sn)) { err = PTR_ERR(sn); - sn = NULL; - } - if (!sn) goto st_failure; + } } if (!fn->leaf) {