diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-08-14 23:33:36 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-08-17 01:35:08 +0300 |
commit | 8b706884eac958ec16518315053f77e052627084 (patch) | |
tree | 8ec79e9d5dcb5427ff0e16e1a38d823b65a99151 /drivers/nfc/st-nci/ndlc.c | |
parent | 1d816b6eb513498aa28a0ff1e4db7632bded1707 (diff) | |
download | linux-8b706884eac958ec16518315053f77e052627084.tar.xz |
nfc: st-nci: Free data with irrelevant NDLC PCB_SYNC value
PCB_SYNC different than PCB_TYPE_SUPERVISOR or PCB_TYPE_DATAFRAME
should be discarded.
Irrelevant data may be forwarded up to the ndlc state machine by
phys like spi to prevent missing potential data during "write"
transactions.
Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/st-nci/ndlc.c')
-rw-r--r-- | drivers/nfc/st-nci/ndlc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nfc/st-nci/ndlc.c b/drivers/nfc/st-nci/ndlc.c index bb08b16f45cf..4f51649d0e75 100644 --- a/drivers/nfc/st-nci/ndlc.c +++ b/drivers/nfc/st-nci/ndlc.c @@ -198,8 +198,10 @@ static void llt_ndlc_rcv_queue(struct llt_ndlc *ndlc) kfree_skb(skb); break; } - } else { + } else if ((pcb & PCB_TYPE_MASK) == PCB_TYPE_DATAFRAME) { nci_recv_frame(ndlc->ndev, skb); + } else { + kfree_skb(skb); } } } |