aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-08-22 22:40:14 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:40:14 -0700
commitae144966c123b21d91baee823836b0272d85624f (patch)
tree20e795d90581857d08d7480813a49dc23bcd1206 /net
parent1326cafc397cd609888edc8776a6e0572e16c67f (diff)
downloadhistory-ae144966c123b21d91baee823836b0272d85624f.tar.gz
[PATCH] err2-6: hashbin_remove_this() locking fix
Fix locking error identified by the Stanford locking checker. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net')
-rw-r--r--net/irda/irqueue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c
index 65a3eb94327c2a..ca948a000ad22d 100644
--- a/net/irda/irqueue.c
+++ b/net/irda/irqueue.c
@@ -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);