summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/nfc/st21nfca/i2c.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index 6c4d0a0fc7fc..4df15ef2528a 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -315,11 +315,10 @@ static int st21nfca_hci_i2c_repack(struct sk_buff *skb)
skb_trim(skb, size);
/* remove ST21NFCA byte stuffing for upper layer */
for (i = 1, j = 0; i < skb->len; i++) {
- if (skb->data[i] ==
+ if (skb->data[i + j] ==
(u8) ST21NFCA_ESCAPE_BYTE_STUFFING) {
- skb->data[i] =
- skb->data[i +
- 1] | ST21NFCA_BYTE_STUFFING_MASK;
+ skb->data[i] = skb->data[i + j + 1]
+ | ST21NFCA_BYTE_STUFFING_MASK;
i++;
j++;
}