aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/nfc/digital_core.c11
-rw-r--r--net/nfc/digital_dep.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c
index a6ce3c627e4e..361bc37d2db1 100644
--- a/net/nfc/digital_core.c
+++ b/net/nfc/digital_core.c
@@ -299,6 +299,7 @@ int digital_target_found(struct nfc_digital_dev *ddev,
299 int rc; 299 int rc;
300 u8 framing; 300 u8 framing;
301 u8 rf_tech; 301 u8 rf_tech;
302 u8 poll_tech_count;
302 int (*check_crc)(struct sk_buff *skb); 303 int (*check_crc)(struct sk_buff *skb);
303 void (*add_crc)(struct sk_buff *skb); 304 void (*add_crc)(struct sk_buff *skb);
304 305
@@ -375,12 +376,16 @@ int digital_target_found(struct nfc_digital_dev *ddev,
375 return rc; 376 return rc;
376 377
377 target->supported_protocols = (1 << protocol); 378 target->supported_protocols = (1 << protocol);
378 rc = nfc_targets_found(ddev->nfc_dev, target, 1);
379 if (rc)
380 return rc;
381 379
380 poll_tech_count = ddev->poll_tech_count;
382 ddev->poll_tech_count = 0; 381 ddev->poll_tech_count = 0;
383 382
383 rc = nfc_targets_found(ddev->nfc_dev, target, 1);
384 if (rc) {
385 ddev->poll_tech_count = poll_tech_count;
386 return rc;
387 }
388
384 return 0; 389 return 0;
385} 390}
386 391
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c
index 171cb9949ab5..7cc1830633cc 100644
--- a/net/nfc/digital_dep.c
+++ b/net/nfc/digital_dep.c
@@ -673,6 +673,7 @@ void digital_tg_recv_atr_req(struct nfc_digital_dev *ddev, void *arg,
673 int rc; 673 int rc;
674 struct digital_atr_req *atr_req; 674 struct digital_atr_req *atr_req;
675 size_t gb_len, min_size; 675 size_t gb_len, min_size;
676 u8 poll_tech_count;
676 677
677 if (IS_ERR(resp)) { 678 if (IS_ERR(resp)) {
678 rc = PTR_ERR(resp); 679 rc = PTR_ERR(resp);
@@ -730,12 +731,16 @@ void digital_tg_recv_atr_req(struct nfc_digital_dev *ddev, void *arg,
730 goto exit; 731 goto exit;
731 732
732 gb_len = resp->len - sizeof(struct digital_atr_req); 733 gb_len = resp->len - sizeof(struct digital_atr_req);
734
735 poll_tech_count = ddev->poll_tech_count;
736 ddev->poll_tech_count = 0;
737
733 rc = nfc_tm_activated(ddev->nfc_dev, NFC_PROTO_NFC_DEP_MASK, 738 rc = nfc_tm_activated(ddev->nfc_dev, NFC_PROTO_NFC_DEP_MASK,
734 NFC_COMM_PASSIVE, atr_req->gb, gb_len); 739 NFC_COMM_PASSIVE, atr_req->gb, gb_len);
735 if (rc) 740 if (rc) {
741 ddev->poll_tech_count = poll_tech_count;
736 goto exit; 742 goto exit;
737 743 }
738 ddev->poll_tech_count = 0;
739 744
740 rc = 0; 745 rc = 0;
741exit: 746exit: