Thread (1 message) 1 message, 1 author, 2015-06-06

[RFC v2 03/17] nfc: nci: Add NCI_RESET return code check before setup

From: Christophe Ricard <hidden>
Date: 2015-06-06 11:16:39
Subsystem: networking [general], nfc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, David Heidelberg, Linus Torvalds

setup was executed in any case, even if NCI_RESET failed.

Signed-off-by: Christophe Ricard <redacted>
---
 net/nfc/nci/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 56d57c9..b900e6a 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,
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help