diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2012-10-10 00:08:56 +0900 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2014-02-10 16:11:32 -0500 |
commit | 3cb827b381dc2aace21720eaef0dee832f3ffd46 (patch) | |
tree | 3f2599f57ff06af61363f788a782c353cfc19481 | |
parent | c6577c482cfa98c8171c99d48606edf83736f150 (diff) |
udf: fix memory leak while allocating blocks during write
commit 2fb7d99d0de3fd8ae869f35ab682581d8455887a upstream.
Need to brelse the buffer_head stored in cur_epos and next_epos.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Ashish Sangwan <a.sangwan@samsung.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | fs/udf/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 8a3fbd177ca..fe64cf54b11 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -654,6 +654,8 @@ static struct buffer_head *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 NULL; } @@ -684,6 +686,8 @@ static struct buffer_head *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); |