goto semopout;
}
+ if (nsops < 0 || nsops > MAX_SOPS) {
+#ifdef SEM_DEBUG
+ printf("too many sops (max=%d, nsops=%d)\n", MAX_SOPS, nsops);
+#endif
+ eval = E2BIG;
+ goto semopout;
+ }
+
#if CONFIG_MACF
/*
* Initial pass thru sops to see what permissions are needed.
goto semopout;
#endif
- if (nsops < 0 || nsops > MAX_SOPS) {
-#ifdef SEM_DEBUG
- printf("too many sops (max=%d, nsops=%d)\n", MAX_SOPS, nsops);
-#endif
- eval = E2BIG;
- goto semopout;
- }
-
/* OK for LP64, since sizeof(struct sembuf) is currently invariant */
if ((eval = copyin(uap->sops, &sops, nsops * sizeof(struct sembuf))) != 0) {
#ifdef SEM_DEBUG