summaryrefslogtreecommitdiff
path: root/net/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-06-06 14:16:39 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2015-06-09 01:34:20 +0300
commit81859ab8779567af491fbf83ea628cdf09188d90 (patch)
treee105b5bcb149263bee2486cde1da77f144ae7c00 /net/nfc
parentb6355e972aaab0173ce11a1650e7dba67f820918 (diff)
downloadlinux-81859ab8779567af491fbf83ea628cdf09188d90.tar.xz
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.c5
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,