OSDN Git Service

gfs2: Fix unused value warning in do_gfs2_set_flags()
authorTim Gardner <tim.gardner@canonical.com>
Mon, 20 Sep 2021 19:05:18 +0000 (13:05 -0600)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Oct 2021 06:42:20 +0000 (08:42 +0200)
Coverity complains of an unused value:

CID 119623 (#1 of 1): Unused value (UNUSED_VALUE)
assigned_value: Assigning value -1 to error here, but that stored value is
overwritten before it can be used.
237        error = -EPERM;

Fix it by removing the assignment.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/file.c

index 0f54d87..8267ab9 100644 (file)
@@ -234,7 +234,6 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask)
        if ((new_flags ^ flags) == 0)
                goto out;
 
-       error = -EPERM;
        if (!IS_IMMUTABLE(inode)) {
                error = gfs2_permission(&init_user_ns, inode, MAY_WRITE);
                if (error)