]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFC: nci: Add NCI_RESET return code check before setup
authorChristophe Ricard <christophe.ricard@gmail.com>
Sat, 6 Jun 2015 11:16:39 +0000 (13:16 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Jun 2015 22:34:20 +0000 (00:34 +0200)
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>
net/nfc/nci/core.c

index 56d57c93ea1a20dd2fb64a56f61d0dd4cab28fd4..b900e6a2a28449156246e132c092405a9880abf9 100644 (file)
@@ -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,