No one may sleep on us until we've been down()'d. So on allocation,
initialize `sleepers' to 0, just like everyone else does.
Signed-off-by: Arthur Othieno <[email protected]>
---
include/asm-xtensa/semaphore.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
30304537ba5143b13071e4d62ecbd1edcf526f41
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h
--- a/include/asm-xtensa/semaphore.h
+++ b/include/asm-xtensa/semaphore.h
@@ -38,6 +38,7 @@ struct semaphore {
static inline void sema_init (struct semaphore *sem, int val)
{
atomic_set(&sem->count, val);
+ sem->sleepers = 0;
init_waitqueue_head(&sem->wait);
}