aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/sock.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-06-22 09:32:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:18 -0400
commit8b7e8eda58cc09974708dcc6db4c202c419d6cd9 (patch)
treee81fee2a721f9aa3009b21a0cddfc30cb7267472 /net/nfc/llcp/sock.c
parentcbbf472181bd5d6229decda96b34b0c2bbcb3050 (diff)
NFC: Forbid LLCP service name reusing
This patch fixes a typo and return the correct error when trying to bind 2 sockets to the same service name. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp/sock.c')
-rw-r--r--net/nfc/llcp/sock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c
index 211cb234f7a3..e5d80142b825 100644
--- a/net/nfc/llcp/sock.c
+++ b/net/nfc/llcp/sock.c
@@ -121,8 +121,10 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
121 GFP_KERNEL); 121 GFP_KERNEL);
122 122
123 llcp_sock->ssap = nfc_llcp_get_sdp_ssap(local, llcp_sock); 123 llcp_sock->ssap = nfc_llcp_get_sdp_ssap(local, llcp_sock);
124 if (llcp_sock->ssap == LLCP_MAX_SAP) 124 if (llcp_sock->ssap == LLCP_SAP_MAX) {
125 ret = -EADDRINUSE;
125 goto put_dev; 126 goto put_dev;
127 }
126 128
127 llcp_sock->reserved_ssap = llcp_sock->ssap; 129 llcp_sock->reserved_ssap = llcp_sock->ssap;
128 130