UBIFS: fix memory leak on error path
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
This commit is contained in:
parent
cf610bf419
commit
812eb25831
1 changed files with 1 additions and 0 deletions
|
@ -669,6 +669,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
|
||||||
|
|
||||||
out_release:
|
out_release:
|
||||||
release_head(c, BASEHD);
|
release_head(c, BASEHD);
|
||||||
|
kfree(dent);
|
||||||
out_ro:
|
out_ro:
|
||||||
ubifs_ro_mode(c, err);
|
ubifs_ro_mode(c, err);
|
||||||
if (last_reference)
|
if (last_reference)
|
||||||
|
|
Loading…
Reference in a new issue