From: Chuck Lever Date: Thu, 11 May 2023 15:47:09 +0000 (-0400) Subject: net/handshake: Remove unneeded check from handshake_dup() X-Git-Tag: microblaze-v6.6~166^2~292^2~5 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=b16d76fe9a27d337c16972a71d959bcf0c96c2e6;p=linux-2.6-microblaze.git net/handshake: Remove unneeded check from handshake_dup() handshake_req_submit() now verifies that the socket has a file. Fixes: 3b3009ea8abb ("net/handshake: Create a NETLINK service for handling handshake requests") Reviewed-by: Simon Horman Signed-off-by: Chuck Lever Signed-off-by: David S. Miller --- diff --git a/net/handshake/netlink.c b/net/handshake/netlink.c index 35c9c445e0b8..7ec8a76c3c8a 100644 --- a/net/handshake/netlink.c +++ b/net/handshake/netlink.c @@ -99,9 +99,6 @@ static int handshake_dup(struct socket *sock) struct file *file; int newfd; - if (!sock->file) - return -EBADF; - file = get_file(sock->file); newfd = get_unused_fd_flags(O_CLOEXEC); if (newfd < 0) {