]> git.itanic.dy.fi Git - linux-stable/commitdiff
net/handshake: Remove unneeded check from handshake_dup()
authorChuck Lever <chuck.lever@oracle.com>
Thu, 11 May 2023 15:47:09 +0000 (11:47 -0400)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 May 2023 05:05:23 +0000 (22:05 -0700)
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 <simon.horman@corigine.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/handshake/netlink.c

index 35c9c445e0b850d8effb2f362f70306c7f1f2dd6..7ec8a76c3c8a73b87b6d7e367fbf382fed501cb5 100644 (file)
@@ -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) {