diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2020-08-06 19:53:16 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-08-19 08:26:59 +0200 |
commit | e6e356db45f43367b033ed137767dfcb197b4c93 (patch) | |
tree | 9a672f654cf35060b1bafd5fb08b5ddcf160fef1 /net/socket.c | |
parent | 5512f2549e3d725ba34fc6a0a10e47ae3de5630d (diff) |
net: Set fput_needed iff FDPUT_FPUT is set
[ Upstream commit ce787a5a074a86f76f5d3fd804fa78e01bfb9e89 ]
We should fput() file iff FDPUT_FPUT is set. So we should set fput_needed
accordingly.
Fixes: 00e188ef6a7e ("sockfd_lookup_light(): switch to fdget^W^Waway from fget_light")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c index 976426d03f09..481fd5f25669 100644 --- a/net/socket.c +++ b/net/socket.c @@ -500,7 +500,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed) if (f.file) { sock = sock_from_file(f.file, err); if (likely(sock)) { - *fput_needed = f.flags; + *fput_needed = f.flags & FDPUT_FPUT; return sock; } fdput(f); |