git: f5b46856918c - main - cred: crget(): Compute initial 'cr_agroups' with nitems()

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Mon, 16 Dec 2024 14:45:21 UTC
The branch main has been updated by olce:

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

commit f5b46856918cc6cc3ea49e3ab95163d318563ece
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-07-16 20:32:19 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-12-16 14:42:29 +0000

    cred: crget(): Compute initial 'cr_agroups' with nitems()
    
    No functional change (intended).
    
    Reviewed by:    mhorne, emaste
    Approved by:    markj (mentor)
    MFC after:      5 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D46910
---
 sys/kern/kern_prot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index d29833f944ab..0b15937d13f3 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -2119,8 +2119,7 @@ crget(void)
 	mac_cred_init(cr);
 #endif
 	cr->cr_groups = cr->cr_smallgroups;
-	cr->cr_agroups =
-	    sizeof(cr->cr_smallgroups) / sizeof(cr->cr_smallgroups[0]);
+	cr->cr_agroups = nitems(cr->cr_smallgroups);
 	return (cr);
 }