summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSu Hui <suhui@nfschina.com>2023-09-25 12:48:07 +0800
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-09-28 15:04:06 +0300
commite4494770a5cad3c9d1d2a65ed15d07656c0d9b82 (patch)
tree486591f6bf800a75239d5e40d826cd0960a6e5c5
parent85a4780dc96ed9dd643bbadf236552b3320fae26 (diff)
fs/ntfs3: Avoid possible memory leak
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>
-rw-r--r--fs/ntfs3/fslog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index 12f28cdf5c83..98ccb6650858 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -2168,8 +2168,10 @@ file_is_valid:
if (!page) {
page = kmalloc(log->page_size, GFP_NOFS);
- if (!page)
- return -ENOMEM;
+ if (!page) {
+ err = -ENOMEM;
+ goto out;
+ }
}
/*