From 8b7e8eda58cc09974708dcc6db4c202c419d6cd9 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 22 Jun 2012 15:32:20 +0200 Subject: 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 --- net/nfc/llcp/sock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'net/nfc') 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) GFP_KERNEL); llcp_sock->ssap = nfc_llcp_get_sdp_ssap(local, llcp_sock); - if (llcp_sock->ssap == LLCP_MAX_SAP) + if (llcp_sock->ssap == LLCP_SAP_MAX) { + ret = -EADDRINUSE; goto put_dev; + } llcp_sock->reserved_ssap = llcp_sock->ssap; -- cgit v1.2.3