ext4: fix an IS_ERR() vs NULL check
The ext4_find_extent() function never returns NULL, it returns error
pointers.
Fixes: 44059e503b03 ("ext4: fast commit recovery path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20201023112232.GB282278@mwanda
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
This commit is contained in:
committed by
Theodore Ts'o
parent
c9200760da
commit
bc18546bf6
@@ -5815,8 +5815,8 @@ int ext4_ext_replay_update_ex(struct inode *inode, ext4_lblk_t start,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
path = ext4_find_extent(inode, start, NULL, 0);
|
path = ext4_find_extent(inode, start, NULL, 0);
|
||||||
if (!path)
|
if (IS_ERR(path))
|
||||||
return -EINVAL;
|
return PTR_ERR(path);
|
||||||
ex = path[path->p_depth].p_ext;
|
ex = path[path->p_depth].p_ext;
|
||||||
if (!ex) {
|
if (!ex) {
|
||||||
ret = -EFSCORRUPTED;
|
ret = -EFSCORRUPTED;
|
||||||
|
|||||||
Reference in New Issue
Block a user