mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
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>
This commit is contained in:
parent
4940d1c355
commit
2a84193f14
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user