From: Jan Kara Date: Mon, 23 Nov 2009 12:24:48 +0000 (-0500) Subject: ext4: fix error handling in ext4_ind_get_blocks() X-Git-Tag: firefly_0821_release~11625^2~652 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cd9c823a6830d6c84f50fe7dabaf281c542d13ef;p=firefly-linux-kernel-4.4.55.git ext4: fix error handling in ext4_ind_get_blocks() (cherry picked from commit 2bba702d4f88d7b010ec37e2527b552588404ae7) When an error happened in ext4_splice_branch we failed to notice that in ext4_ind_get_blocks and mapped the buffer anyway. Fix the problem by checking for error properly. Signed-off-by: Jan Kara Signed-off-by: "Theodore Ts'o" Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 68c9055a4d91..c27816a2c4fd 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1021,7 +1021,7 @@ static int ext4_ind_get_blocks(handle_t *handle, struct inode *inode, if (!err) err = ext4_splice_branch(handle, inode, iblock, partial, indirect_blks, count); - else + if (err) goto cleanup; set_buffer_new(bh_result);