Skip to content

Commit

Permalink
UBIFS: fix memory leak on error path
Browse files Browse the repository at this point in the history
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>
Cc: stable@kernel.org
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jun 3, 2011
1 parent cf610bf commit 812eb25
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ubifs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,

out_release:
release_head(c, BASEHD);
kfree(dent);
out_ro:
ubifs_ro_mode(c, err);
if (last_reference)
Expand Down

0 comments on commit 812eb25

Please sign in to comment.