Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Soheil Hassas Yeganeh and committed by
David S. Miller
f8e7718c 882b0f2f

+1 -3
+1 -3
net/packet/af_packet.c
··· 1930 1930 sockc.tsflags = sk->sk_tsflags; 1931 1931 if (msg->msg_controllen) { 1932 1932 err = sock_cmsg_send(sk, msg, &sockc); 1933 - if (unlikely(err)) { 1934 - err = -EINVAL; 1933 + if (unlikely(err)) 1935 1934 goto out_unlock; 1936 - } 1937 1935 } 1938 1936 1939 1937 skb->protocol = proto;