git: cb3c7be3a916 - stable/13 - cr_bsd_visible(): Style fixes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 Jan 2024 21:10:15 UTC
The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cb3c7be3a91651f6937dbae5cf3483e54ac28f80 commit cb3c7be3a91651f6937dbae5cf3483e54ac28f80 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2024-01-05 15:23:19 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2024-01-18 21:09:50 +0000 cr_bsd_visible(): Style fixes Explicitly test for non-zero return codes. Separate assignment and testing of 'error' in distinct lines. Reviewed by: emaste, kib Approved by: emaste (mentor) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43335 (cherry picked from commit a1e37beb45d270ae9926eff3b93e9398d08c94e5) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 1c9e2927bc5e..a91b7ec3015f 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1463,11 +1463,14 @@ cr_bsd_visible(struct ucred *u1, struct ucred *u2) { int error; - if ((error = cr_canseeotheruids(u1, u2))) + error = cr_canseeotheruids(u1, u2); + if (error != 0) return (error); - if ((error = cr_canseeothergids(u1, u2))) + error = cr_canseeothergids(u1, u2); + if (error != 0) return (error); - if ((error = cr_canseejailproc(u1, u2))) + error = cr_canseejailproc(u1, u2); + if (error != 0) return (error); return (0); }