diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2016-04-30 03:12:50 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2016-05-03 19:42:31 -0400 |
commit | de5ea8517c2ae40785fe5d0a2d02fc71bef1761b (patch) | |
tree | 5f555db8a94361cb44bc2dee4c244ec282513a3b | |
parent | 18836029d8c074ac1846167ba702ac528e0a0ad7 (diff) |
nfc: nci: Fix nci_core_conn_close
nci_core_conn_close was not retrieving a conn_info using the correct
connection id.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | net/nfc/nci/core.c | 1 | ||||
-rw-r--r-- | net/nfc/nci/rsp.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 031ac0f9538c..0884f1444817 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -646,6 +646,7 @@ static void nci_core_conn_close_req(struct nci_dev *ndev, unsigned long opt) | |||
646 | 646 | ||
647 | int nci_core_conn_close(struct nci_dev *ndev, u8 conn_id) | 647 | int nci_core_conn_close(struct nci_dev *ndev, u8 conn_id) |
648 | { | 648 | { |
649 | ndev->cur_conn_id = conn_id; | ||
649 | return __nci_request(ndev, nci_core_conn_close_req, conn_id, | 650 | return __nci_request(ndev, nci_core_conn_close_req, conn_id, |
650 | msecs_to_jiffies(NCI_CMD_TIMEOUT)); | 651 | msecs_to_jiffies(NCI_CMD_TIMEOUT)); |
651 | } | 652 | } |
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c index 9b6eb913d801..69fe163b7350 100644 --- a/net/nfc/nci/rsp.c +++ b/net/nfc/nci/rsp.c | |||
@@ -271,7 +271,8 @@ static void nci_core_conn_close_rsp_packet(struct nci_dev *ndev, | |||
271 | 271 | ||
272 | pr_debug("status 0x%x\n", status); | 272 | pr_debug("status 0x%x\n", status); |
273 | if (status == NCI_STATUS_OK) { | 273 | if (status == NCI_STATUS_OK) { |
274 | conn_info = nci_get_conn_info_by_conn_id(ndev, ndev->cur_id); | 274 | conn_info = nci_get_conn_info_by_conn_id(ndev, |
275 | ndev->cur_conn_id); | ||
275 | if (conn_info) { | 276 | if (conn_info) { |
276 | list_del(&conn_info->list); | 277 | list_del(&conn_info->list); |
277 | devm_kfree(&ndev->nfc_dev->dev, conn_info); | 278 | devm_kfree(&ndev->nfc_dev->dev, conn_info); |