Commit 6b07edeb authored by Miaohe Lin's avatar Miaohe Lin Committed by David S. Miller

net: Use helper function fdput()

Use helper function fdput() to fput() the file iff FDPUT_FPUT is set.
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d02cbc46
...@@ -1804,8 +1804,7 @@ int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, ...@@ -1804,8 +1804,7 @@ int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr,
ret = __sys_accept4_file(f.file, 0, upeer_sockaddr, ret = __sys_accept4_file(f.file, 0, upeer_sockaddr,
upeer_addrlen, flags, upeer_addrlen, flags,
rlimit(RLIMIT_NOFILE)); rlimit(RLIMIT_NOFILE));
if (f.flags) fdput(f);
fput(f.file);
} }
return ret; return ret;
...@@ -1868,8 +1867,7 @@ int __sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen) ...@@ -1868,8 +1867,7 @@ int __sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen)
ret = move_addr_to_kernel(uservaddr, addrlen, &address); ret = move_addr_to_kernel(uservaddr, addrlen, &address);
if (!ret) if (!ret)
ret = __sys_connect_file(f.file, &address, addrlen, 0); ret = __sys_connect_file(f.file, &address, addrlen, 0);
if (f.flags) fdput(f);
fput(f.file);
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment