diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-06-22 15:32:20 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 22:42:18 +0200 |
commit | 8b7e8eda58cc09974708dcc6db4c202c419d6cd9 (patch) | |
tree | e81fee2a721f9aa3009b21a0cddfc30cb7267472 /net/nfc | |
parent | NFC: Release LLCP SAP when the owner is released (diff) | |
download | linux-8b7e8eda58cc09974708dcc6db4c202c419d6cd9.tar.xz linux-8b7e8eda58cc09974708dcc6db4c202c419d6cd9.zip |
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')
-rw-r--r-- | net/nfc/llcp/sock.c | 4 |
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) 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; |