]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfc: st-nci: Free data with irrelevant NDLC PCB_SYNC value
authorChristophe Ricard <christophe.ricard@gmail.com>
Fri, 14 Aug 2015 20:33:36 +0000 (22:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:33:15 +0000 (19:33 +0200)
commit 8b706884eac958ec16518315053f77e052627084 upstream.

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.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nfc/st-nci/ndlc.c

index bb08b16f45cfe9418bb24cc06e5d989e98768714..4f51649d0e7553d81c100f4559dec539a2c025e0 100644 (file)
@@ -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);
                }
        }
 }