NFC: st21nfca: Free buffer when a bad frame is detected
authorChristophe Ricard <christophe.ricard@gmail.com>
Thu, 24 Apr 2014 21:19:35 +0000 (23:19 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 4 May 2014 23:04:10 +0000 (01:04 +0200)
When a bad frame is detected for a bad crc.
We were reallocating and loosing the previous frame pointer.

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

index b64d8e2e429a0ad3dd11840239d91c6dce69cb74..2337737c6cd4236f1db7d914a078a01537b94c01 100644 (file)
@@ -476,6 +476,7 @@ static irqreturn_t st21nfca_hci_irq_thread_fn(int irq, void *phy_id)
                msleep(wait_tab[phy->crc_trials]);
                phy->crc_trials++;
                phy->current_read_len = 0;
+               kfree_skb(phy->pending_skb);
        } else if (r > 0) {
                /*
                 * We succeeded to read data from the CLF and