aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/nci/rsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc/nci/rsp.c')
-rw-r--r--net/nfc/nci/rsp.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
index 041de51ccdbe..93b914937263 100644
--- a/net/nfc/nci/rsp.c
+++ b/net/nfc/nci/rsp.c
@@ -140,13 +140,31 @@ static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev,
140 140
141static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) 141static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
142{ 142{
143 struct nci_conn_info *conn_info;
143 __u8 status = skb->data[0]; 144 __u8 status = skb->data[0];
144 145
145 pr_debug("status 0x%x\n", status); 146 pr_debug("status 0x%x\n", status);
146 147
147 if (status == NCI_STATUS_OK) 148 if (status == NCI_STATUS_OK) {
148 atomic_set(&ndev->state, NCI_DISCOVERY); 149 atomic_set(&ndev->state, NCI_DISCOVERY);
149 150
151 conn_info = nci_get_conn_info_by_conn_id(ndev,
152 NCI_STATIC_RF_CONN_ID);
153 if (!conn_info) {
154 conn_info = devm_kzalloc(&ndev->nfc_dev->dev,
155 sizeof(struct nci_conn_info),
156 GFP_KERNEL);
157 if (!conn_info) {
158 status = NCI_STATUS_REJECTED;
159 goto exit;
160 }
161 conn_info->conn_id = NCI_STATIC_RF_CONN_ID;
162 INIT_LIST_HEAD(&conn_info->list);
163 list_add(&conn_info->list, &ndev->conn_info_list);
164 }
165 }
166
167exit:
150 nci_req_complete(ndev, status); 168 nci_req_complete(ndev, status);
151} 169}
152 170