--- linux/ipc/sem.c 2004-03-26 05:19:22.833959160 -0800 +++ linux.new/ipc/sem.c 2004-03-26 21:18:28.424699632 -0800 @@ -972,8 +972,10 @@ static struct sem_undo *find_undo(int se if(sma==NULL) goto out; un = ERR_PTR(-EIDRM); - if (sem_checkid(sma,semid)) - goto out_unlock; + if (sem_checkid(sma,semid)) { + sem_unlock(sma); + goto out; + } nsems = sma->sem_nsems; sem_unlock(sma); @@ -1004,7 +1006,6 @@ static struct sem_undo *find_undo(int se sma->undo = new; sem_unlock(sma); un = new; -out_unlock: unlock_semundo(); out: return un;