Skip to content

Commit

Permalink
NFC: Don't hold a NULL connecting LLCP socket lock
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz committed Jun 4, 2012
1 parent dadb06f commit 5a0f6f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,17 +477,17 @@ static struct nfc_llcp_sock *nfc_llcp_connecting_sock_get(struct nfc_llcp_local
sk_for_each(sk, node, &local->connecting_sockets.head) {
llcp_sock = nfc_llcp_sock(sk);

if (llcp_sock->ssap == ssap)
if (llcp_sock->ssap == ssap) {
sock_hold(&llcp_sock->sk);
goto out;
}
}

llcp_sock = NULL;

out:
read_unlock(&local->connecting_sockets.lock);

sock_hold(&llcp_sock->sk);

return llcp_sock;
}

Expand Down

0 comments on commit 5a0f6f3

Please sign in to comment.