diff mbox series

[v2] ext4: lost brelse in __ext4_read_dirblock()

Message ID e269cf8c-b5ca-3eed-bd60-a8629378db8b@virtuozzo.com
State Accepted, archived
Headers show
Series [v2] ext4: lost brelse in __ext4_read_dirblock() | expand

Commit Message

Vasily Averin Nov. 7, 2018, 5:30 p.m. UTC
Fixes dc6982ff4db1 ("ext4: refactor code to read directory blocks ...")
Cc: stable@kernel.org # 3.9

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/ext4/namei.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Theodore Ts'o Nov. 8, 2018, 3:38 a.m. UTC | #1
On Wed, Nov 07, 2018 at 08:30:17PM +0300, Vasily Averin wrote:
> Fixes dc6982ff4db1 ("ext4: refactor code to read directory blocks ...")
> Cc: stable@kernel.org # 3.9
> 
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>

Thanks, applied.  I used the commit description:

    ext4: fix buffer leak in __ext4_read_dirblock() on error path

	      	     			    - Ted
diff mbox series

Patch

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index d388cce72db2..6a6b90363ef1 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -126,6 +126,7 @@  static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
 	if (!is_dx_block && type == INDEX) {
 		ext4_error_inode(inode, func, line, block,
 		       "directory leaf block found instead of index block");
+		brelse(bh);
 		return ERR_PTR(-EFSCORRUPTED);
 	}
 	if (!ext4_has_metadata_csum(inode->i_sb) ||