From patchwork Wed May 16 13:32:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 10403949 X-Patchwork-Delegate: sameo@linux.intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B730860155 for ; Wed, 16 May 2018 13:33:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B41E289A9 for ; Wed, 16 May 2018 13:33:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21FF628995; Wed, 16 May 2018 13:33:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EAA8289A0 for ; Wed, 16 May 2018 13:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbeEPNc4 (ORCPT ); Wed, 16 May 2018 09:32:56 -0400 Received: from mail.bugwerft.de ([46.23.86.59]:35186 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585AbeEPNcy (ORCPT ); Wed, 16 May 2018 09:32:54 -0400 Received: from localhost.localdomain (200116b8467d0800fc4322f50d1cf4c2.dip.versatel-1u1.de [IPv6:2001:16b8:467d:800:fc43:22f5:d1c:f4c2]) by mail.bugwerft.de (Postfix) with ESMTPSA id 4BB22282598; Wed, 16 May 2018 13:30:27 +0000 (UTC) From: Daniel Mack To: sameo@linux.intel.com, davem@davemloft.net Cc: linux-wireless@vger.kernel.org, Daniel Mack Subject: [PATCH 2/2] NFC: st95hf: drop illegal kfree_skb() Date: Wed, 16 May 2018 15:32:47 +0200 Message-Id: <20180516133247.25986-2-daniel@zonque.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180516133247.25986-1-daniel@zonque.org> References: <20180516133247.25986-1-daniel@zonque.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The skb that is passed in to ->in_send_cmd() is freed by the core when the function returns. Calling kfree_skb() on it from the driver callback will hence lead to a double-free. Signed-off-by: Daniel Mack --- drivers/nfc/st95hf/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 394bdc7b0cf2..a50a95cfcfd8 100644 --- a/drivers/nfc/st95hf/core.c +++ b/drivers/nfc/st95hf/core.c @@ -995,8 +995,6 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, goto free_skb_resp; } - kfree_skb(skb); - return rc; free_skb_resp: