From: Robert Dolca Date: Thu, 22 Oct 2015 09:11:36 +0000 (+0300) Subject: NFC: nci: Do not call post_setup when setup fails X-Git-Tag: v4.4-rc1~141^2~42^2~51 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e4dbd62528931951aa9d3b313ee7d536df5069fc;p=linux.git NFC: nci: Do not call post_setup when setup fails The driver should know that it can continue with post setup where setup left off. Being able to execute post_setup when setup fails may force the developer to keep this state in the driver. Signed-off-by: Robert Dolca Signed-off-by: Samuel Ortiz --- diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 090972033a15..5362d8f543e7 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -402,9 +402,8 @@ static int nci_open_device(struct nci_dev *ndev) msecs_to_jiffies(NCI_INIT_TIMEOUT)); } - if (ndev->ops->post_setup) { + if (!rc && ndev->ops->post_setup) rc = ndev->ops->post_setup(ndev); - } if (!rc) { rc = __nci_request(ndev, nci_init_complete_req, 0,