]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ext4: fix an IS_ERR() vs NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Oct 2020 11:22:32 +0000 (14:22 +0300)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 4 Jan 2021 15:47:29 +0000 (16:47 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910111
commit bc18546bf68e47996a359d2533168d5770a22024 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/ext4/extents.c

index 17d7096b3212dc778ccbe36ec3adf0ecc15069c8..12eac88373032db8b892d78fc7d78413dbc1a669 100644 (file)
@@ -5815,8 +5815,8 @@ int ext4_ext_replay_update_ex(struct inode *inode, ext4_lblk_t start,
        int ret;
 
        path = ext4_find_extent(inode, start, NULL, 0);
-       if (!path)
-               return -EINVAL;
+       if (IS_ERR(path))
+               return PTR_ERR(path);
        ex = path[path->p_depth].p_ext;
        if (!ex) {
                ret = -EFSCORRUPTED;