summaryrefslogtreecommitdiffstats
path: root/net/nfc/nci
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc/nci')
-rw-r--r--net/nfc/nci/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index c3dfd4e13bd..9f17e8ec0ab 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -361,8 +361,13 @@ static int nci_start_poll(struct nfc_dev *nfc_dev, __u32 protocols)
return -EBUSY;
}
+ if (ndev->target_active_prot) {
+ nfc_err("there is an active target");
+ return -EBUSY;
+ }
+
if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) {
- nfc_dbg("target already active, first deactivate...");
+ nfc_dbg("target is active, implicitly deactivate...");
rc = nci_request(ndev, nci_rf_deactivate_req, 0,
msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));