NFC: st21nfcb: Avoid use of skb after free
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 25 Jan 2015 22:33:23 +0000 (23:33 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Jan 2015 22:14:33 +0000 (23:14 +0100)
Do not insert in send queue the skb that contains unknown Packet Control
Byte

Acked-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfcb/ndlc.c

index ef0f997dae0a0713ba7caa30dbf9cd30936571c6..5fbf59d2138c1b0a0c723550905d37931a89bcbe 100644 (file)
@@ -138,7 +138,7 @@ static void llt_ndlc_requeue_data_pending(struct llt_ndlc *ndlc)
                default:
                        pr_err("UNKNOWN Packet Control Byte=%d\n", pcb);
                        kfree_skb(skb);
-                       break;
+                       continue;
                }
                skb_queue_head(&ndlc->send_q, skb);
        }