summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_sem.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-11-13 08:06:40 +0000
committerrwatson <rwatson@FreeBSD.org>2004-11-13 08:06:40 +0000
commit5f3907b408cad1b9f73876298c950ec219318716 (patch)
tree70c9d37cb14d846b376790c4e45b1ce4354c3cd8 /sys/kern/sysv_sem.c
parent5673b9b142750596a95806aa97f6a507940ba9e7 (diff)
downloadFreeBSD-src-5f3907b408cad1b9f73876298c950ec219318716.zip
FreeBSD-src-5f3907b408cad1b9f73876298c950ec219318716.tar.gz
Correct two incorrectly merged changes introduced in sysv_sem.c:1.71:
return EINVAL rather than setting error, and don't free sops unconditionally. The first change was merged accidentally as part of the larger set of changes to introduce MAC labels and access control, and potentially lead to continued processing of a request even after it was determined to be invalid. The second change was due to changes in the semaphore code since the original work was performed. Pointed out by: truckman
Diffstat (limited to 'sys/kern/sysv_sem.c')
-rw-r--r--sys/kern/sysv_sem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index 4f2779b..de2308e 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -901,7 +901,7 @@ semop(td, uap)
semid = IPCID_TO_IX(semid); /* Convert back to zero origin */
if (semid < 0 || semid >= seminfo.semmni)
- error = EINVAL;
+ return (EINVAL);
/* Allocate memory for sem_ops */
if (nsops <= SMALL_SOPS)
@@ -1153,7 +1153,6 @@ done2:
mtx_unlock(sema_mtxp);
if (sops != small_sops)
free(sops, M_SEM);
- free(sops, M_SEM);
return (error);
}
OpenPOWER on IntegriCloud