From: Miaohe Lin Date: Thu, 6 Aug 2020 11:52:24 +0000 (+0800) Subject: net: Use helper function fdput() X-Git-Tag: v5.10.7~1846^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b07edebe6d31529346e553a7b309bc5251da712;p=platform%2Fkernel%2Flinux-rpi.git net: Use helper function fdput() Use helper function fdput() to fput() the file iff FDPUT_FPUT is set. Signed-off-by: Miaohe Lin Signed-off-by: David S. Miller --- diff --git a/net/socket.c b/net/socket.c index aff52e8..3c3d6ab 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1804,8 +1804,7 @@ int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, ret = __sys_accept4_file(f.file, 0, upeer_sockaddr, upeer_addrlen, flags, rlimit(RLIMIT_NOFILE)); - if (f.flags) - fput(f.file); + fdput(f); } return ret; @@ -1868,8 +1867,7 @@ int __sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen) ret = move_addr_to_kernel(uservaddr, addrlen, &address); if (!ret) ret = __sys_connect_file(f.file, &address, addrlen, 0); - if (f.flags) - fput(f.file); + fdput(f); } return ret;