__sock_cmsg_send() might return different error codes, not only -EINVAL.
Fixes: 24025c465f77 ("ipv4: process socket-level control messages in IPv4")
Fixes: ad1e46a83716 ("ipv6: process socket-level control messages in IPv6")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
                }
 #endif
                if (cmsg->cmsg_level == SOL_SOCKET) {
-                       if (__sock_cmsg_send(sk, msg, cmsg, &ipc->sockc))
-                               return -EINVAL;
+                       err = __sock_cmsg_send(sk, msg, cmsg, &ipc->sockc);
+                       if (err)
+                               return err;
                        continue;
                }
 
 
                }
 
                if (cmsg->cmsg_level == SOL_SOCKET) {
-                       if (__sock_cmsg_send(sk, msg, cmsg, sockc))
-                               return -EINVAL;
+                       err = __sock_cmsg_send(sk, msg, cmsg, sockc);
+                       if (err)
+                               return err;
                        continue;
                }