Commit 8b7e8eda authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville

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: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent cbbf4721
...@@ -121,8 +121,10 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) ...@@ -121,8 +121,10 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
GFP_KERNEL); GFP_KERNEL);
llcp_sock->ssap = nfc_llcp_get_sdp_ssap(local, llcp_sock); 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; goto put_dev;
}
llcp_sock->reserved_ssap = llcp_sock->ssap; llcp_sock->reserved_ssap = llcp_sock->ssap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment