--- a/pthread_spin_unlock.c
+++ b/pthread_spin_unlock.c
@@ -61,9 +61,8 @@
 					      (PTW32_INTERLOCKED_LONG) PTW32_SPIN_LOCKED))
     {
     case PTW32_SPIN_LOCKED:
+    case PTW32_SPIN_UNLOCKED:
       return 0;
-    case PTW32_SPIN_UNLOCKED:
-      return EPERM;
     case PTW32_SPIN_USE_MUTEX:
       return pthread_mutex_unlock (&(s->u.mutex));
     }