Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fb7d99d authored by Namjae Jeon's avatar Namjae Jeon Committed by Jan Kara
Browse files

udf: fix memory leak while allocating blocks during write



Need to brelse the buffer_head stored in cur_epos and next_epos.

Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarAshish Sangwan <a.sangwan@samsung.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 25389bb2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -765,6 +765,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
				goal, err);
		if (!newblocknum) {
			brelse(prev_epos.bh);
			brelse(cur_epos.bh);
			brelse(next_epos.bh);
			*err = -ENOSPC;
			return 0;
		}
@@ -795,6 +797,8 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
	udf_update_extents(inode, laarr, startnum, endnum, &prev_epos);

	brelse(prev_epos.bh);
	brelse(cur_epos.bh);
	brelse(next_epos.bh);

	newblock = udf_get_pblock(inode->i_sb, newblocknum,
				iinfo->i_location.partitionReferenceNum, 0);