summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSoheil Hassas Yeganeh <soheil@google.com>2016-07-20 18:01:18 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-22 01:41:48 -0400
commitf8e7718cc0445587fe8530fc2d240d9aac2c9072 (patch)
tree26133ea508e6001b91adef1482973c8b528927a5 /net
parent882b0f2fba83374149f0a5869d95aa8b44dad31e (diff)
packet: propagate sock_cmsg_send() error
sock_cmsg_send() can return different error codes and not only -EINVAL, and we should properly propagate them. Fixes: c14ac9451c34 ("sock: enable timestamping using control messages") Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com> Cc: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/packet/af_packet.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 53e87ceb26e7..b43c4015b2f7 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1930,10 +1930,8 @@ retry:
1930 sockc.tsflags = sk->sk_tsflags; 1930 sockc.tsflags = sk->sk_tsflags;
1931 if (msg->msg_controllen) { 1931 if (msg->msg_controllen) {
1932 err = sock_cmsg_send(sk, msg, &sockc); 1932 err = sock_cmsg_send(sk, msg, &sockc);
1933 if (unlikely(err)) { 1933 if (unlikely(err))
1934 err = -EINVAL;
1935 goto out_unlock; 1934 goto out_unlock;
1936 }
1937 } 1935 }
1938 1936
1939 skb->protocol = proto; 1937 skb->protocol = proto;