patch-2.3.29 linux/ipc/sem.c

Next file: linux/kernel/fork.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.28/linux/ipc/sem.c linux/ipc/sem.c
@@ -494,6 +494,8 @@
 	if(sma==NULL)
 		return -EINVAL;
 
+	nsems = sma->sem_nsems;
+
 	err=-EIDRM;
 	if (sem_checkid(sma,semid))
 		goto out_unlock;
@@ -502,7 +504,6 @@
 	if (ipcperms (&sma->sem_perm, (cmd==SETVAL||cmd==SETALL)?S_IWUGO:S_IRUGO))
 		goto out_unlock;
 
-	nsems = sma->sem_nsems;
 	switch (cmd) {
 	case GETALL:
 	{

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)