git: cb2ae6163174 - main - sysvsem: Fix a typo
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 14 May 2022 11:07:56 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cb2ae6163174b90e999326ecec3699ee093a5d43 commit cb2ae6163174b90e999326ecec3699ee093a5d43 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2022-05-14 11:07:20 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-05-14 11:07:20 +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 --- 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 4a76eedd4f7c..4104f1343cb7 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 */