git: 2fe96ee7537b - stable/13 - sysvsem: Fix a typo

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Fri, 17 Jun 2022 19:40:28 UTC
The branch stable/13 has been updated by dchagin:

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

commit 2fe96ee7537bd6072a365616f05a058dd23f7513
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-05-14 11:07:20 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-17 19:35:17 +0000

    sysvsem: Fix a typo
    
    Per jamie@ rpr can be NULL if the jail is created with sysvsem=disable.
    But at least it doesn't appear to be fatal, since rpr is never dereferenced
    but is only compared to other prison pointers.
    
    Reviewed by:            jamie
    Differential revision:  https://reviews.freebsd.org/D35198
    MFC after:              2 weeks
    
    (cherry picked from commit cb2ae6163174b90e999326ecec3699ee093a5d43)
---
 sys/kern/sysv_sem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index 469291d76d86..65fe2a233572 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -710,7 +710,7 @@ kern_semctl(struct thread *td, int semid, int semnum, int cmd,
 	AUDIT_ARG_SVIPC_ID(semid);
 
 	rpr = sem_find_prison(td->td_ucred);
-	if (sem == NULL)
+	if (rpr == NULL)
 		return (ENOSYS);
 
 	array = NULL;
@@ -1130,7 +1130,7 @@ kern_semop(struct thread *td, int usemid, struct sembuf *usops,
 	AUDIT_ARG_SVIPC_ID(usemid);
 
 	rpr = sem_find_prison(td->td_ucred);
-	if (sem == NULL)
+	if (rpr == NULL)
 		return (ENOSYS);
 
 	semid = IPCID_TO_IX(usemid);	/* Convert back to zero origin */