fs/ntfs3: Avoid possible memory leak

[ Upstream commit e4494770a5 ]

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>
This commit is contained in:
Su Hui 2023-09-25 12:48:07 +08:00 committed by Greg Kroah-Hartman
parent 27a0bed128
commit 64ae128b09
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}
}
/*