diff options
author | Chengguang Xu <[email protected]> | 2019-11-05 12:51:00 +0800 |
---|---|---|
committer | Jan Kara <[email protected]> | 2019-11-05 10:42:18 +0100 |
commit | e705f4b8aa27a59f8933e8f384e9752f052c469c (patch) | |
tree | 28e8ffd6412895107cc52f1140004ef4f9db7edb | |
parent | df4bb5d128e2c44848aeb36b7ceceba3ac85080d (diff) |
ext2: check err when partial != NULL
Check err when partial == NULL is meaningless because
partial == NULL means getting branch successfully without
error.
CC: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Chengguang Xu <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
-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 7004ce581a32..a16c53655e77 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -701,10 +701,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; + } } /* |