mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
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: 00e188ef6a
("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>
This commit is contained in:
parent
6b07edebe6
commit
ce787a5a07
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user