Skip to content

Commit

Permalink
NFC: Forbid LLCP service name reusing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jul 9, 2012
1 parent cbbf472 commit 8b7e8ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/nfc/llcp/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8b7e8ed

Please sign in to comment.