Commit ae144966 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] err2-6: hashbin_remove_this() locking fix

Fix locking error identified by the Stanford locking checker.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1326cafc
......@@ -663,8 +663,10 @@ void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry)
} /* Default is no-lock */
/* Check if valid and not already removed... */
if((entry->q_next == NULL) || (entry->q_prev == NULL))
return NULL;
if((entry->q_next == NULL) || (entry->q_prev == NULL)) {
entry = NULL;
goto out;
}
/*
* Locate hashbin
......@@ -687,7 +689,7 @@ void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry)
*/
if ( entry == hashbin->hb_current)
hashbin->hb_current = NULL;
out:
/* Release lock */
if ( hashbin->hb_type & HB_LOCK ) {
spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment