diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-31 01:40:40 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-06-03 11:12:31 -0400 |
commit | 812eb258311f89bcd664a34a620f249d54a2cd83 (patch) | |
tree | 2b1598190efd598cfbdff30fbca302426f796e3a /fs/ubifs | |
parent | cf610bf4199770420629d3bc273494bd27ad6c1d (diff) |
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
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/journal.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 34b1679e6e3a..cef0460f4c54 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c | |||
@@ -669,6 +669,7 @@ out_free: | |||
669 | 669 | ||
670 | out_release: | 670 | out_release: |
671 | release_head(c, BASEHD); | 671 | release_head(c, BASEHD); |
672 | kfree(dent); | ||
672 | out_ro: | 673 | out_ro: |
673 | ubifs_ro_mode(c, err); | 674 | ubifs_ro_mode(c, err); |
674 | if (last_reference) | 675 | if (last_reference) |