1 ext4 crypto: fix memleak in ext4_readdir()
3 From: Kirill Tkhai <ktkhai@virtuozzo.com>
5 When ext4_bread() fails, fname_crypto_str remains
6 allocated after return. Fix that.
8 Cc: Dmitry Monakhov <dmonakhov@virtuozzo.com>
9 Cc: stable@vger.kernel.org
10 Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 fs/ext4/dir.c | 7 +++++--
14 1 file changed, 5 insertions(+), 2 deletions(-)
16 diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
17 index 1d1bca7..def3215 100644
20 @@ -157,8 +157,11 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
22 file->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT;
23 bh = ext4_bread(NULL, inode, map.m_lblk, 0);