Skip to content

Commit e449477

Browse files
Su Huiaalexandrovich
authored andcommitted
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>
1 parent 85a4780 commit e449477

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/ntfs3/fslog.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,8 +2168,10 @@ static int last_log_lsn(struct ntfs_log *log)
21682168

21692169
if (!page) {
21702170
page = kmalloc(log->page_size, GFP_NOFS);
2171-
if (!page)
2172-
return -ENOMEM;
2171+
if (!page) {
2172+
err = -ENOMEM;
2173+
goto out;
2174+
}
21732175
}
21742176

21752177
/*

0 commit comments

Comments
 (0)