Skip to contentSkip to conversation

xtensa: struct semaphore.sleepers initialization

PATCH New Arthur Othieno 1 participant 1 message Oct 29, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xtensa: struct semaphore.sleepers initialization

No one may sleep on us until we've been down()'d. So on allocation, initialize `sleepers' to 0, just like everyone else does.

---

 include/asm-xtensa/semaphore.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

30304537ba5143b13071e4d62ecbd1edcf526f41

include/asm-xtensa/semaphore.h +1 -0
@@ -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);
 }