diff options
author | Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> | 2019-08-28 11:01:22 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-23 11:30:18 +0300 |
commit | 2f5253c5e9ecacd0c9724022e94acaf3c7c545ce (patch) | |
tree | 09e303f8ce94f5e36356f55ddaf2ee6fe4a1a7a3 /fs/anon_inodes.c | |
parent | 401876dbcf6be94b31a957ccccb8e028e9d3d9cc (diff) | |
download | linux-2f5253c5e9ecacd0c9724022e94acaf3c7c545ce.tar.xz |
NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context fails
[ Upstream commit 8605cf0e852af3b2c771c18417499dc4ceed03d5 ]
When dreq is allocated by nfs_direct_req_alloc(), dreq->kref is
initialized to 2. Therefore we need to call nfs_direct_req_release()
twice to release the allocated dreq. Usually it is called in
nfs_file_direct_{read, write}() and nfs_direct_complete().
However, current code only calls nfs_direct_req_relese() once if
nfs_get_lock_context() fails in nfs_file_direct_{read, write}().
So, that case would result in memory leak.
Fix this by adding the missing call.
Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/anon_inodes.c')
0 files changed, 0 insertions, 0 deletions