From patchwork Thu Jan 15 10:30:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anda-Maria Nicolae X-Patchwork-Id: 5638321 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EB2249F665 for ; Thu, 15 Jan 2015 10:28:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F5F020131 for ; Thu, 15 Jan 2015 10:28:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35EA22012E for ; Thu, 15 Jan 2015 10:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751939AbbAOK22 (ORCPT ); Thu, 15 Jan 2015 05:28:28 -0500 Received: from mga14.intel.com ([192.55.52.115]:26482 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbbAOK21 (ORCPT ); Thu, 15 Jan 2015 05:28:27 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 15 Jan 2015 02:23:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,402,1418112000"; d="scan'208";a="512633633" Received: from anda-hp-z230-tower-workstation.rb.intel.com (HELO work.rb.intel.com) ([10.237.104.174]) by orsmga003.jf.intel.com with ESMTP; 15 Jan 2015 02:22:09 -0800 From: Anda-Maria Nicolae To: lauro.venancio@openbossa.org, aloisio.almeida@openbossa.org, sameo@linux.intel.com, christophe.ricard@gmail.com, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH] NFC: st21nfcb: Avoid use of skb after free Date: Thu, 15 Jan 2015 12:30:57 +0200 Message-Id: <1421317857-1713-1-git-send-email-anda-maria.nicolae@intel.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not insert in send queue the skb that contains unknown Packet Control Byte Signed-off-by: Anda-Maria Nicolae Acked-by: Christophe Ricard --- Only compile tested, please have a look drivers/nfc/st21nfcb/ndlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/st21nfcb/ndlc.c b/drivers/nfc/st21nfcb/ndlc.c index bac50e8..72659a3 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); }