From patchwork Thu Oct 20 17:00:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9387299 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 7CFD760487 for ; Thu, 20 Oct 2016 17:02:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A82B29C0C for ; Thu, 20 Oct 2016 17:02:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EF6929CEB; Thu, 20 Oct 2016 17:02:34 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 77A1729C0C for ; Thu, 20 Oct 2016 17:02:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxGiO-0000BC-2t; Thu, 20 Oct 2016 17:01:12 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxGiJ-0007yL-Pq; Thu, 20 Oct 2016 17:01:09 +0000 Received: by mail-pf0-x243.google.com with SMTP id 128so6086656pfz.1; Thu, 20 Oct 2016 10:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZKGnO4Ev7FqxX1bWu5QjJvqDCfBy/8PKp/cZho0TF6w=; b=OOrrWdtdthWt30ScZP6UE7Xy4j0XOknCLmF5hLt99Sbx9q2tgrvQZuVz9HNawHhlcC 8XZLZF/Yz5DMV2PbQ1Sr2csN+l2YQ5NvgJ+OouY64MJLfrRHd+psLoGl5/aBLSOA+XNr YsFh2lq57YkV2uMa2bZ5T9WZSWh45bdwt41LW/8rvrLPvlHS9ezconT0rmV/cXZSRZ0N jTUfBLdz5MayVtqp9FBdLtoJa04ZYCJRnPp4+nYcu4Kwm5zvRoc2iWsgLVGxxdM/tA53 Yckbh0FkqbBvZhWiTGvkPXeftV9TzjaEZwtfmHSOarqA9b+MubxGU9ltOemS/NnfkJgn 2l1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZKGnO4Ev7FqxX1bWu5QjJvqDCfBy/8PKp/cZho0TF6w=; b=lzrvFyCi9YBlYlHJ4c+x3BQ0HnWVeCvEra5DxAXpnevKen5VpZahxc5ie8+yncAc6g utnTKEc7fY2w48D+6W1YsK0I570B/VmYfPp7vwvad27DDBhPRWyzGQnSrhGbxzXdEh0i BHb4fm4ZHyecbKvcBSFA4EFPrvXGRTEX5/MHnCapgEUgDyiYxhfhmJp93vzfo/Dwoqx9 MMc26NRjNCUrsSZN/OTcFilPbJIJOknroPCWdptgd9tzX8lgskvmoSwIIhpoXBNMx70o td556cIyNSrCmrk4AG54VbJTTik5H2wfDPfGxhPuMrxl5zM2S3kw8b89opJd0StTklQ9 vReA== X-Gm-Message-State: AA6/9RlrJPrrUtTskvdAnecFqy5ksVD2dIaSZ5GgkkNDaBFdj7PvoZsBIhBUkhvHhpz7BA== X-Received: by 10.99.113.14 with SMTP id m14mr2435019pgc.57.1476982846298; Thu, 20 Oct 2016 10:00:46 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id fl4sm73220040pad.39.2016.10.20.10.00.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2016 10:00:45 -0700 (PDT) From: Wei Yongjun To: Felix Fietkau , John Crispin , Matthias Brugger Subject: [PATCH -next] net: ethernet: mediatek: use dev_kfree_skb_any instead of dev_kfree_skb Date: Thu, 20 Oct 2016 17:00:32 +0000 Message-Id: <1476982832-27932-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161020_100107_934255_991C2A42 X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, Wei Yongjun , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Replace dev_kfree_skb with dev_kfree_skb_any in mtk_start_xmit() which can be called from hard irq context (netpoll) and from other contexts. mtk_start_xmit() only frees skbs that it has dropped. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 8f80e61..d716274 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -843,7 +843,7 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) drop: spin_unlock(ð->page_lock); stats->tx_dropped++; - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); return NETDEV_TX_OK; }