[IPV4]: Fix error handling for fib_insert_node call
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 12 Jul 2006 20:29:56 +0000 (13:29 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 12 Jul 2006 20:59:04 +0000 (13:59 -0700)
The error handling around fib_insert_node was broken because we always
zeroed the error before checking it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c

index 1cb65305e1029b9bd47de0f041a469f098cb550f..23fb9d9768e369ecc0093805add00cf3f251a158 100644 (file)
@@ -1252,8 +1252,8 @@ fn_trie_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
         */
 
        if (!fa_head) {
-               fa_head = fib_insert_node(t, &err, key, plen);
                err = 0;
+               fa_head = fib_insert_node(t, &err, key, plen);
                if (err)
                        goto out_free_new_fa;
        }