Skip to content

Commit

Permalink
fs/ntfs3: Fix some memory leaks in an error handling path of 'log_rep…
Browse files Browse the repository at this point in the history
…lay()'

commit e589f9b upstream.

All error handling paths lead to 'out' where many resources are freed.

Do it as well here instead of a direct return, otherwise 'log', 'ra' and
'log->one_page_buf' (at least) will leak.

Fixes: b46acd6 ("fs/ntfs3: Add NTFS journal")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
tititiou36 authored and gregkh committed Jun 9, 2022
1 parent 895d0a9 commit bc4a1d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/ntfs3/fslog.c
Expand Up @@ -4085,8 +4085,10 @@ int log_replay(struct ntfs_inode *ni, bool *initialized)
if (client == LFS_NO_CLIENT_LE) {
/* Insert "NTFS" client LogFile. */
client = ra->client_idx[0];
if (client == LFS_NO_CLIENT_LE)
return -EINVAL;
if (client == LFS_NO_CLIENT_LE) {
err = -EINVAL;
goto out;
}

t16 = le16_to_cpu(client);
cr = ca + t16;
Expand Down

0 comments on commit bc4a1d3

Please sign in to comment.