summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-05-21 11:44:42 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-06-04 21:34:31 +0200
commit5a0f6f3b46b28310262ad9585b80062ef56c5362 (patch)
tree65c3c0328b8cebb4f9842127ae875b2f96c54cb1 /net
parentNFC: Implement the pn533 target mode Tx op (diff)
downloadlinux-5a0f6f3b46b28310262ad9585b80062ef56c5362.tar.xz
linux-5a0f6f3b46b28310262ad9585b80062ef56c5362.zip
NFC: Don't hold a NULL connecting LLCP socket lock
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/nfc/llcp/llcp.c6
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;
}