summaryrefslogtreecommitdiff
path: root/net/socket.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2020-08-06 19:53:16 +0800
committerDavid S. Miller <davem@davemloft.net>2020-08-08 14:21:42 -0700
commitce787a5a074a86f76f5d3fd804fa78e01bfb9e89 (patch)
tree1a05f6d3fe7007dc70a56e0ee3652d6c59de7af9 /net/socket.c
parent6b07edebe6d31529346e553a7b309bc5251da712 (diff)
net: Set fput_needed iff FDPUT_FPUT is set
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>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c
index 3c3d6abe4c1e..e08415b4f939 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);