ext2: check err when partial != NULL
PATCH 1/1 ext2: check err when partial != NULL
Check err when partial == NULL is meaningless because partial == NULL means getting branch successfully without error.
Signed-off-by Chengguang Xu <[email protected]>
--- fs/ext2/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/ext2/inode.c +5 -2
@@ -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; + } }/*
Signature · 1 line
2.20.1
Quoted 5 lines · Chengguang Xu
Check err when partial == NULL is meaningless because partial == NULL means getting branch successfully without error.
Signed-off-by Chengguang Xu <[email protected]>
Good catch! Added to my tree. Thanks!
Honza
Quoted 29 lines
--- fs/ext2/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)fs/ext2/inode.c +5
-2@@ -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; + } }/* Signature · 1 line
2.20.1
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR