From: Christophe Ricard Date: Thu, 24 Apr 2014 21:19:35 +0000 (+0200) Subject: NFC: st21nfca: Free buffer when a bad frame is detected X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c942b007b52cdcde285fa1122688f186bf99464;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git NFC: st21nfca: Free buffer when a bad frame is detected When a bad frame is detected for a bad crc. We were reallocating and loosing the previous frame pointer. Signed-off-by: Christophe Ricard Signed-off-by: Samuel Ortiz --- diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index b64d8e2e429a..2337737c6cd4 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -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