|
@@ -1887,16 +1887,22 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
|
|
|
}
|
|
|
|
|
|
error = -EFBIG;
|
|
|
- if (max >= sma->sem_nsems)
|
|
|
- goto out_rcu_wakeup;
|
|
|
+ if (max >= sma->sem_nsems) {
|
|
|
+ rcu_read_unlock();
|
|
|
+ goto out_free;
|
|
|
+ }
|
|
|
|
|
|
error = -EACCES;
|
|
|
- if (ipcperms(ns, &sma->sem_perm, alter ? S_IWUGO : S_IRUGO))
|
|
|
- goto out_rcu_wakeup;
|
|
|
+ if (ipcperms(ns, &sma->sem_perm, alter ? S_IWUGO : S_IRUGO)) {
|
|
|
+ rcu_read_unlock();
|
|
|
+ goto out_free;
|
|
|
+ }
|
|
|
|
|
|
error = security_sem_semop(sma, sops, nsops, alter);
|
|
|
- if (error)
|
|
|
- goto out_rcu_wakeup;
|
|
|
+ if (error) {
|
|
|
+ rcu_read_unlock();
|
|
|
+ goto out_free;
|
|
|
+ }
|
|
|
|
|
|
error = -EIDRM;
|
|
|
locknum = sem_lock(sma, sops, nsops);
|
|
@@ -2039,7 +2045,6 @@ sleep_again:
|
|
|
|
|
|
out_unlock_free:
|
|
|
sem_unlock(sma, locknum);
|
|
|
-out_rcu_wakeup:
|
|
|
rcu_read_unlock();
|
|
|
wake_up_sem_queue_do(&tasks);
|
|
|
out_free:
|