From: Soheil Hassas Yeganeh Date: Wed, 20 Jul 2016 22:01:18 +0000 (-0400) Subject: packet: propagate sock_cmsg_send() error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8e7718cc0445587fe8530fc2d240d9aac2c9072;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Willem de Bruijn Signed-off-by: David S. Miller --- 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: 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;