diff options
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r-- | net/ipv4/inet_diag.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index b5e781b529aa..cb98cbed1973 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -895,13 +895,16 @@ static int __inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, | |||
895 | struct inet_diag_req_v2 *r, struct nlattr *bc) | 895 | struct inet_diag_req_v2 *r, struct nlattr *bc) |
896 | { | 896 | { |
897 | const struct inet_diag_handler *handler; | 897 | const struct inet_diag_handler *handler; |
898 | int err = 0; | ||
898 | 899 | ||
899 | handler = inet_diag_lock_handler(r->sdiag_protocol); | 900 | handler = inet_diag_lock_handler(r->sdiag_protocol); |
900 | if (!IS_ERR(handler)) | 901 | if (!IS_ERR(handler)) |
901 | handler->dump(skb, cb, r, bc); | 902 | handler->dump(skb, cb, r, bc); |
903 | else | ||
904 | err = PTR_ERR(handler); | ||
902 | inet_diag_unlock_handler(handler); | 905 | inet_diag_unlock_handler(handler); |
903 | 906 | ||
904 | return skb->len; | 907 | return err ? : skb->len; |
905 | } | 908 | } |
906 | 909 | ||
907 | static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) | 910 | static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) |