diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-22 08:58:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-22 08:58:50 +0200 |
commit | 639e1c739bf53814b67a1d5f945d76fd4358453c (patch) | |
tree | d3bad09907d05228851267b1ddd3ba3a6fd39fe0 /net/ipv4/fib_frontend.c | |
parent | staging: greybus: mark PM functions as __maybe_unused (diff) | |
parent | Linux 4.12-rc2 (diff) | |
download | linux-dev-639e1c739bf53814b67a1d5f945d76fd4358453c.tar.xz linux-dev-639e1c739bf53814b67a1d5f945d76fd4358453c.zip |
Merge 4.12-rc2 into staging-next
We want the staging tree fixes in here as well to handle the merge
issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r-- | net/ipv4/fib_frontend.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 39bd1edee676..83e3ed258467 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -763,7 +763,7 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) unsigned int e = 0, s_e; struct fib_table *tb; struct hlist_head *head; - int dumped = 0; + int dumped = 0, err; if (nlmsg_len(cb->nlh) >= sizeof(struct rtmsg) && ((struct rtmsg *) nlmsg_data(cb->nlh))->rtm_flags & RTM_F_CLONED) @@ -783,20 +783,27 @@ static int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) if (dumped) memset(&cb->args[2], 0, sizeof(cb->args) - 2 * sizeof(cb->args[0])); - if (fib_table_dump(tb, skb, cb) < 0) - goto out; + err = fib_table_dump(tb, skb, cb); + if (err < 0) { + if (likely(skb->len)) + goto out; + + goto out_err; + } dumped = 1; next: e++; } } out: + err = skb->len; +out_err: rcu_read_unlock(); cb->args[1] = e; cb->args[0] = h; - return skb->len; + return err; } /* Prepare and feed intra-kernel routing request. |