Commit c906f38e authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Theodore Ts'o

ext4: fix memleak in ext4_readdir()

When ext4_bread() fails, fname_crypto_str remains
allocated after return. Fix that.
Signed-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
CC: Dmitry Monakhov <dmonakhov@virtuozzo.com>
parent 56263b4c
...@@ -163,8 +163,11 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx) ...@@ -163,8 +163,11 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
index, 1); index, 1);
file->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT; file->f_ra.prev_pos = (loff_t)index << PAGE_CACHE_SHIFT;
bh = ext4_bread(NULL, inode, map.m_lblk, 0); bh = ext4_bread(NULL, inode, map.m_lblk, 0);
if (IS_ERR(bh)) if (IS_ERR(bh)) {
return PTR_ERR(bh); err = PTR_ERR(bh);
bh = NULL;
goto errout;
}
} }
if (!bh) { if (!bh) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment