diff options
author | Su Hui <suhui@nfschina.com> | 2023-09-25 12:48:07 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-08 17:26:46 +0100 |
commit | 64ae128b095de92dbbb1eaabfabf820ee1acd263 (patch) | |
tree | ff36ca909d69a771825619e6871ae827cb754580 | |
parent | 27a0bed1285e4d1497b8ead28657b681b9796c60 (diff) | |
download | aa-64ae128b095de92dbbb1eaabfabf820ee1acd263.tar.gz |
fs/ntfs3: Avoid possible memory leak
[ Upstream commit e4494770a5cad3c9d1d2a65ed15d07656c0d9b82 ]
smatch warn:
fs/ntfs3/fslog.c:2172 last_log_lsn() warn: possible memory leak of 'page_bufs'
Jump to label 'out' to free 'page_bufs' and is more consistent with
other code.
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/ntfs3/fslog.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index 59f813cbdaa8eb..8b95c06e5a4c5b 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -2169,8 +2169,10 @@ file_is_valid: if (!page) { page = kmalloc(log->page_size, GFP_NOFS); - if (!page) - return -ENOMEM; + if (!page) { + err = -ENOMEM; + goto out; + } } /* |