Skip to content

Commit 344bfe4

Browse files
Artem Bityutskiygregkh
authored andcommitted
UBIFS: fix memory leak on error path
commit 812eb25 upstream. UBIFS leaks memory on error path in 'ubifs_jnl_update()' in case of write failure because it forgets to free the 'struct ubifs_dent_node *dent' object. Although the object is small, the alignment can make it large - e.g., 2KiB if the min. I/O unit is 2KiB. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 103b2f0 commit 344bfe4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/ubifs/journal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
666666

667667
out_release:
668668
release_head(c, BASEHD);
669+
kfree(dent);
669670
out_ro:
670671
ubifs_ro_mode(c, err);
671672
if (last_reference)

0 commit comments

Comments
 (0)