diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-06-06 13:16:39 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-06-09 00:34:20 +0200 |
commit | 81859ab8779567af491fbf83ea628cdf09188d90 (patch) | |
tree | e105b5bcb149263bee2486cde1da77f144ae7c00 /net/nfc | |
parent | b6355e972aaab0173ce11a1650e7dba67f820918 (diff) |
NFC: nci: Add NCI_RESET return code check before setup
setup was executed in any case, even if NCI_RESET failed.
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/core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 56d57c93ea1a..b900e6a2a284 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -347,8 +347,9 @@ static int nci_open_device(struct nci_dev *ndev) rc = __nci_request(ndev, nci_reset_req, 0, msecs_to_jiffies(NCI_RESET_TIMEOUT)); - if (ndev->ops->setup) - ndev->ops->setup(ndev); + if (!rc && ndev->ops->setup) { + rc = ndev->ops->setup(ndev); + } if (!rc) { rc = __nci_request(ndev, nci_init_req, 0, |