From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755943AbbIZU62 (ORCPT ); Sat, 26 Sep 2015 16:58:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55298 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754129AbbIZU5K (ORCPT ); Sat, 26 Sep 2015 16:57:10 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Ricard , Samuel Ortiz Subject: [PATCH 4.2 007/134] nfc: st-nci: Free data with irrelevant NDLC PCB_SYNC value Date: Sat, 26 Sep 2015 13:54:19 -0700 Message-Id: <20150926205312.291304680@linuxfoundation.org> X-Mailer: git-send-email 2.5.3 In-Reply-To: <20150926205311.819185658@linuxfoundation.org> References: <20150926205311.819185658@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Ricard 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 Signed-off-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/st-nci/ndlc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 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 ll kfree_skb(skb); break; } - } else { + } else if ((pcb & PCB_TYPE_MASK) == PCB_TYPE_DATAFRAME) { nci_recv_frame(ndlc->ndev, skb); + } else { + kfree_skb(skb); } } }