summaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-12-23 23:45:15 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-12-29 19:06:18 +0100
commit2a84193f14c4196ee94bf1d44c5f28bcabe7e840 (patch)
tree8f03600f3864673771c01f2e4ea798a1f8c99de9 /net/nfc
parent4940d1c35535c32e6d6e950d91efa485eab41d76 (diff)
downloadlinux-stable-2a84193f14c4196ee94bf1d44c5f28bcabe7e840.tar.gz
linux-stable-2a84193f14c4196ee94bf1d44c5f28bcabe7e840.tar.bz2
linux-stable-2a84193f14c4196ee94bf1d44c5f28bcabe7e840.zip
NFC: nci: Fix error check of nci_hci_create_pipe() result
net/nfc/nci/hci.c: In function nci_hci_connect_gate : net/nfc/nci/hci.c:679: warning: comparison is always false due to limited range of data type In case of error, nci_hci_create_pipe() returns NCI_HCI_INVALID_PIPE, and not a negative error code. Correct the check to fix this. Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/hci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c
index 2aedac15cb59..a0ab26d535dc 100644
--- a/net/nfc/nci/hci.c
+++ b/net/nfc/nci/hci.c
@@ -676,7 +676,7 @@ int nci_hci_connect_gate(struct nci_dev *ndev,
break;
default:
pipe = nci_hci_create_pipe(ndev, dest_host, dest_gate, &r);
- if (pipe < 0)
+ if (pipe == NCI_HCI_INVALID_PIPE)
return r;
pipe_created = true;
break;