Skip to contentSkip to conversation

NFC: double unlock in nfc_llcp_recv_connect()

PATCH In review Dan Carpenter 2 participants 2 messages Dec 16, 2011 – Dec 18, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 NFC: double unlock in nfc_llcp_recv_connect()

We unlock inside the if block on the other side of this if else statement. It could result in calling mutex_unlock() twice.

net/nfc/llcp/llcp.c +1 -3
index 67756b2..f99d6b4 100644
@@ -554,11 +554,9 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local,
 				goto enqueue;
 			}
 		}
-
+		mutex_unlock(&local->socket_lock);
 	}
 
-	mutex_unlock(&local->socket_lock);
-
 	reason = LLCP_DM_NOBOUND;
 	goto fail;