Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8e7718c authored by Soheil Hassas Yeganeh's avatar Soheil Hassas Yeganeh Committed by David S. Miller
Browse files

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: c14ac945 ("sock: enable timestamping using control messages")
Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 882b0f2f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1930,11 +1930,9 @@ 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;
	skb->dev = dev;