From: Christophe Ricard Date: Sun, 25 Jan 2015 22:33:23 +0000 (+0100) Subject: NFC: st21nfcb: Avoid use of skb after free X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=20842466ec6d823ae9d3991b86527b6a1460ec63;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git NFC: st21nfcb: Avoid use of skb after free Do not insert in send queue the skb that contains unknown Packet Control Byte Acked-by: Christophe Ricard Signed-off-by: Anda-Maria Nicolae Signed-off-by: Samuel Ortiz --- diff --git a/drivers/nfc/st21nfcb/ndlc.c b/drivers/nfc/st21nfcb/ndlc.c index ef0f997dae0a..5fbf59d2138c 100644 --- a/drivers/nfc/st21nfcb/ndlc.c +++ b/drivers/nfc/st21nfcb/ndlc.c @@ -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); }