summaryrefslogtreecommitdiffstats
path: root/drivers/nfc/st21nfca
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-03-31 02:02:16 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2015-04-05 18:17:02 -0400
commit9906a88df224bc2b8be50fdb14df5eda0936fe34 (patch)
tree8645f2fe97b45601567b6e10c410247614cd71ef /drivers/nfc/st21nfca
parentd4a41d10b2cb5890aeda6b2912973b2a754b05b1 (diff)
NFC: st21nfca: fix st21nfca_get_iso14443_3_uid data copy
st21nfca_get_iso14443_3_uid() does not correctly copy the uid from uid_skb->data to its gate parameter. "gate = uid_skb->data;" only puts a pointer to uid_skb->data to the local variable gate. This means that in st21nfca_hci_target_from_gate() the content of "u8 uid[NFC_NFCID1_MAXSIZE]" local variable is never initialized before being used in memcpy(target->nfcid1, uid, len). Fix this by replacing the local variable assignment with a memcpy. This was found by compiling Linux with "gcc -Wunused-but-set-parameter". Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/st21nfca')
-rw-r--r--drivers/nfc/st21nfca/st21nfca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c
index 24d3d240d5f4..ff70d2838b29 100644
--- a/drivers/nfc/st21nfca/st21nfca.c
+++ b/drivers/nfc/st21nfca/st21nfca.c
@@ -588,7 +588,7 @@ static int st21nfca_get_iso14443_3_uid(struct nfc_hci_dev *hdev, u8 *gate,
588 goto exit; 588 goto exit;
589 } 589 }
590 590
591 gate = uid_skb->data; 591 memcpy(gate, uid_skb->data, uid_skb->len);
592 *len = uid_skb->len; 592 *len = uid_skb->len;
593exit: 593exit:
594 kfree_skb(uid_skb); 594 kfree_skb(uid_skb);