Skip to contentSkip to conversation

gfs2: Fix unused value warning in do_gfs2_set_flags()

PATCH Applied Tim Gardner 2 participants 2 messages Sep 20, 2021 – Oct 13, 2021 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: Fix unused value warning in do_gfs2_set_flags()

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.

Cc Bob Peterson <[email protected]>
Cc Andreas Gruenbacher <[email protected]>
Cc cluster-devel at redhat.com
Cc linux-kernel at vger.kernel.org
---
 fs/gfs2/file.c | 1 -
 1 file changed, 1 deletion(-)
fs/gfs2/file.c +0 -1
index 354cf85154a6..7e09d2168030 100644
@@ -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)
Signature · 1 line
2.33.0
maintainer Applied
#1 lore raw

Hi Tim,

Quoted 8 lines · Tim Gardner

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.

pushed to for-next.

Thanks,
Andreas