NFC: st21nfca: Change nfcid3 generation
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 10 Aug 2014 22:04:52 +0000 (00:04 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 7 Sep 2014 22:04:21 +0000 (00:04 +0200)
nfcid3 is based on sensf_res value. target->sensf is never NULL
as it is a table.
Check the sensf_res_len instead to make sure sensf_res is set or not.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfca/st21nfca_dep.c

index a62b6485cbbe31eff6627db2693dba8e314ee2d1..cd942c5adc53def786da308cf514d2dfdfc36191 100644 (file)
@@ -523,7 +523,7 @@ int st21nfca_im_send_atr_req(struct nfc_hci_dev *hdev, u8 *gb, size_t gb_len)
        memset(atr_req->nfcid3, 0, NFC_NFCID3_MAXSIZE);
        target = hdev->ndev->targets;
 
-       if (target->sensf_res)
+       if (target->sensf_res_len > 0)
                memcpy(atr_req->nfcid3, target->sensf_res,
                                target->sensf_res_len);
        else