]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fix for sem_lock
authorRik van Riel <riel@surriel.com>
Fri, 22 Mar 2013 23:42:48 +0000 (19:42 -0400)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Mar 2013 05:33:45 +0000 (16:33 +1100)
Fix a typo in sem_lock.  Of course we need to unlock the local
semaphore lock before jumping to lock_all, in the rare case that
somebody started a complex operation while we were spinning on
the spinlock.

Can be folded into patch 7/7 before merging

Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Michel Lespinasse <walken@google.com>
ipc/sem.c

index 53968950ad2cf423eca3cafd49d7436d83a5d036..1a2913da2bddf91a1b6e2c05cca6a32c36be349f 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -346,7 +346,7 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
                 * we may need to look at things we did not lock here.
                 */
                if (unlikely(sma->complex_count)) {
-                       spin_unlock(&sma->sem_perm.lock);
+                       spin_unlock(&sem->lock);
                        goto lock_all;
                }
                locknum = sops->sem_num;