]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/fib_trie.c
Merge tag 'pci-v4.12-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[karo-tx-linux.git] / net / ipv4 / fib_trie.c
index 1201409ba1dcb18ee028003b065410b87bf4a602..51182ff2b4415238210e83208bf7f45b5fb55326 100644 (file)
@@ -1983,6 +1983,8 @@ static int fn_trie_dump_leaf(struct key_vector *l, struct fib_table *tb,
 
        /* rcu_read_lock is hold by caller */
        hlist_for_each_entry_rcu(fa, &l->leaf, fa_list) {
+               int err;
+
                if (i < s_i) {
                        i++;
                        continue;
@@ -1993,17 +1995,14 @@ static int fn_trie_dump_leaf(struct key_vector *l, struct fib_table *tb,
                        continue;
                }
 
-               if (fib_dump_info(skb, NETLINK_CB(cb->skb).portid,
-                                 cb->nlh->nlmsg_seq,
-                                 RTM_NEWROUTE,
-                                 tb->tb_id,
-                                 fa->fa_type,
-                                 xkey,
-                                 KEYLENGTH - fa->fa_slen,
-                                 fa->fa_tos,
-                                 fa->fa_info, NLM_F_MULTI) < 0) {
+               err = fib_dump_info(skb, NETLINK_CB(cb->skb).portid,
+                                   cb->nlh->nlmsg_seq, RTM_NEWROUTE,
+                                   tb->tb_id, fa->fa_type,
+                                   xkey, KEYLENGTH - fa->fa_slen,
+                                   fa->fa_tos, fa->fa_info, NLM_F_MULTI);
+               if (err < 0) {
                        cb->args[4] = i;
-                       return -1;
+                       return err;
                }
                i++;
        }
@@ -2025,10 +2024,13 @@ int fib_table_dump(struct fib_table *tb, struct sk_buff *skb,
        t_key key = cb->args[3];
 
        while ((l = leaf_walk_rcu(&tp, key)) != NULL) {
-               if (fn_trie_dump_leaf(l, tb, skb, cb) < 0) {
+               int err;
+
+               err = fn_trie_dump_leaf(l, tb, skb, cb);
+               if (err < 0) {
                        cb->args[3] = key;
                        cb->args[2] = count;
-                       return -1;
+                       return err;
                }
 
                ++count;