]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: remove unreachable code in libxfs_inode_alloc
authorEric Sandeen <sandeen@redhat.com>
Sun, 12 Apr 2015 23:33:49 +0000 (09:33 +1000)
committerDave Chinner <david@fromorbit.com>
Sun, 12 Apr 2015 23:33:49 +0000 (09:33 +1000)
This code does:

        if (!ialloc_context && !ip)
                return;

        // if !ip here, ialloc_context must be true

        if (ialloc_context) {
                ...
                if (!ip)
                        error = ENOSPC;
                if (error)
                        return error;
                // if !ip in this block we've returned
        }

        // so (!ip) cannot be true here
        if (!ip)
                error = ENOSPC;

(cherry picked this one out of Coverity reports)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/util.c

index 6464a1b19b172e2a547772722dfd744a36c71499..49eb76d4a658a6db9a6b4d1dde034a40440b43ef 100644 (file)
@@ -700,8 +700,6 @@ libxfs_inode_alloc(
                if (error)
                        return error;
        }
-       if (!ip)
-               error = ENOSPC;
 
        *ipp = ip;
        return error;