diff options
author | Chengguang Xu <cgxu519@mykernel.net> | 2019-11-05 12:51:00 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-17 20:35:18 +0100 |
commit | 26eca105bceae8c9d49e5d4b2829220acb4ef676 (patch) | |
tree | 1b7449d54080e9fe175511e76a85936177704670 /fs/ext2 | |
parent | 77b14d6ebc6e3dff9c6db607d32bd82bd46e79e8 (diff) |
ext2: check err when partial != NULL
commit e705f4b8aa27a59f8933e8f384e9752f052c469c upstream.
Check err when partial == NULL is meaningless because
partial == NULL means getting branch successfully without
error.
CC: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191105045100.7104-1-cgxu519@mykernel.net
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/inode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index e4bb9386c045..36a2ab6f6150 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -699,10 +699,13 @@ static int ext2_get_blocks(struct inode *inode, if (!partial) { count++; mutex_unlock(&ei->truncate_mutex); - if (err) - goto cleanup; goto got_it; } + + if (err) { + mutex_unlock(&ei->truncate_mutex); + goto cleanup; + } } /* |