nfc: nci: Fix nci_core_conn_close
authorChristophe Ricard <christophe.ricard@gmail.com>
Sat, 30 Apr 2016 07:12:50 +0000 (09:12 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 3 May 2016 23:42:31 +0000 (01:42 +0200)
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>
net/nfc/nci/core.c
net/nfc/nci/rsp.c

index 031ac0f9538c074f3ff01e9c543ca769cc27ae08..0884f1444817117f3bc0f5d992554d06d52359db 100644 (file)
@@ -646,6 +646,7 @@ static void nci_core_conn_close_req(struct nci_dev *ndev, unsigned long opt)
 
 int nci_core_conn_close(struct nci_dev *ndev, u8 conn_id)
 {
+       ndev->cur_conn_id = conn_id;
        return __nci_request(ndev, nci_core_conn_close_req, conn_id,
                             msecs_to_jiffies(NCI_CMD_TIMEOUT));
 }
index 9b6eb913d801b000dc4f50eb3bf0bad7435e7e34..69fe163b7350825f1a4731a8357ac99c45da385f 100644 (file)
@@ -271,7 +271,8 @@ static void nci_core_conn_close_rsp_packet(struct nci_dev *ndev,
 
        pr_debug("status 0x%x\n", status);
        if (status == NCI_STATUS_OK) {
-               conn_info = nci_get_conn_info_by_conn_id(ndev, ndev->cur_id);
+               conn_info = nci_get_conn_info_by_conn_id(ndev,
+                                                        ndev->cur_conn_id);
                if (conn_info) {
                        list_del(&conn_info->list);
                        devm_kfree(&ndev->nfc_dev->dev, conn_info);