From: Christophe Ricard Date: Sat, 6 Jun 2015 11:16:39 +0000 (+0200) Subject: NFC: nci: Add NCI_RESET return code check before setup X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=81859ab8779567af491fbf83ea628cdf09188d90;p=linux-beck.git 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 Signed-off-by: Samuel Ortiz --- 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,