Skip to content

Commit

Permalink
packet: propagate sock_cmsg_send() error
Browse files Browse the repository at this point in the history
sock_cmsg_send() can return different error codes and not only
-EINVAL, and we should properly propagate them.

Fixes: c14ac94 ("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>
  • Loading branch information
Soheil Hassas Yeganeh authored and David S. Miller committed Jul 22, 2016
1 parent 882b0f2 commit f8e7718
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1930,10 +1930,8 @@ static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg,
sockc.tsflags = sk->sk_tsflags;
if (msg->msg_controllen) {
err = sock_cmsg_send(sk, msg, &sockc);
if (unlikely(err)) {
err = -EINVAL;
if (unlikely(err))
goto out_unlock;
}
}

skb->protocol = proto;
Expand Down

0 comments on commit f8e7718

Please sign in to comment.