diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-21 11:44:42 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-06-04 21:34:31 +0200 |
commit | 5a0f6f3b46b28310262ad9585b80062ef56c5362 (patch) | |
tree | 65c3c0328b8cebb4f9842127ae875b2f96c54cb1 /net/nfc/llcp | |
parent | dadb06f270ad7cd9572b82995f6261f8ca4620ac (diff) |
NFC: Don't hold a NULL connecting LLCP socket lock
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp')
-rw-r--r-- | net/nfc/llcp/llcp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index 5705e6dffb32..b694313c2be5 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c @@ -477,8 +477,10 @@ 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; @@ -486,8 +488,6 @@ static struct nfc_llcp_sock *nfc_llcp_connecting_sock_get(struct nfc_llcp_local out: read_unlock(&local->connecting_sockets.lock); - sock_hold(&llcp_sock->sk); - return llcp_sock; } |