Commit 8b7e8eda58cc09974708dcc6db4c202c419d6cd9

Authored by Samuel Ortiz
Committed by John W. Linville
1 parent cbbf472181

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>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -121,8 +121,10 @@
121 121 GFP_KERNEL);
122 122  
123 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 126 goto put_dev;
  127 + }
126 128  
127 129 llcp_sock->reserved_ssap = llcp_sock->ssap;
128 130