Messages in this thread Patch in this message |  | | Date | Wed, 22 Jan 1997 23:17:52 -0500 | From | "David S. Miller" <> | Subject | ypbind bug in SMP test kernel fixed... |
| |
Here is a patch for that silly bug. This goes on top of the patch I just posted.
--- linux/ipc/sem.c.~1~ Sat Jan 4 22:59:40 1997 +++ linux/ipc/sem.c Wed Jan 22 23:14:09 1997 @@ -499,9 +499,10 @@ goto out; copy_from_user (sem_io, array, nsems*sizeof(ushort)); for (i = 0; i < nsems; i++) - err = -ERANGE; - if (sem_io[i] > SEMVMX) + if (sem_io[i] > SEMVMX) { + err = -ERANGE; goto out; + } break; case IPC_STAT: buf = arg.buf; @@ -640,9 +641,10 @@ if (!un) { size = sizeof(struct sem_undo) + sizeof(short)*sma->sem_nsems; un = (struct sem_undo *) kmalloc(size, GFP_ATOMIC); - error = -ENOMEM; - if (!un) + if (!un) { + error = -ENOMEM; goto out; + } memset(un, 0, size); un->semadj = (short *) &un[1]; un->semid = semid;
|  |