git: 31223e68e299 - main - Simplify the code.

From: Pawel Jakub Dawidek <pjd_at_FreeBSD.org>
Date: Wed, 22 May 2024 03:03:54 UTC
The branch main has been updated by pjd:

URL: https://cgit.FreeBSD.org/src/commit/?id=31223e68e299cc7dbef4573adb368918f260b6ef

commit 31223e68e299cc7dbef4573adb368918f260b6ef
Author:     Pawel Jakub Dawidek <pjd@FreeBSD.org>
AuthorDate: 2024-05-19 01:58:14 +0000
Commit:     Pawel Jakub Dawidek <pjd@FreeBSD.org>
CommitDate: 2024-05-22 03:01:24 +0000

    Simplify the code.
    
    Obtained from: Fudo Security
    Reviewed by: asomers, imp
    Approved by: oshogbo (mentor)
    Differential Revision: https://reviews.freebsd.org/D45247
---
 sys/fs/fuse/fuse_vnops.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c
index 3f8f3322162a..925838c89bcb 100644
--- a/sys/fs/fuse/fuse_vnops.c
+++ b/sys/fs/fuse/fuse_vnops.c
@@ -2248,19 +2248,14 @@ fuse_vnop_setattr(struct vop_setattr_args *ap)
 					return (err2);
 				if (vap->va_uid != old_va.va_uid)
 					return err;
-				else
-					accmode |= VADMIN;
 				drop_suid = true;
-			} else
-				accmode |= VADMIN;
-		} else
-			accmode |= VADMIN;
+		}
+		accmode |= VADMIN;
 	}
 	if (vap->va_gid != (gid_t)VNOVAL) {
 		if (checkperm && priv_check_cred(cred, PRIV_VFS_CHOWN))
 			drop_suid = true;
-		if (checkperm && !groupmember(vap->va_gid, cred))
-		{
+		if (checkperm && !groupmember(vap->va_gid, cred)) {
 			/*
 			 * Non-root users may only chgrp to one of their own
 			 * groups 
@@ -2274,11 +2269,8 @@ fuse_vnop_setattr(struct vop_setattr_args *ap)
 					return (err2);
 				if (vap->va_gid != old_va.va_gid)
 					return err;
-				accmode |= VADMIN;
-			} else
-				accmode |= VADMIN;
-		} else
-			accmode |= VADMIN;
+		}
+		accmode |= VADMIN;
 	}
 	if (vap->va_size != VNOVAL) {
 		switch (vp->v_type) {