From patchwork Fri Oct 21 01:32:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Changzhong X-Patchwork-Id: 6469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp415798wrr; Thu, 20 Oct 2022 18:23:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ssgqDuGU0dUN6lnpAwsgjHrvWi9af85ldMznusCHRi33S0HfqA4X4VuoqZdlPEX/UKJpt X-Received: by 2002:a63:231a:0:b0:46b:208f:1e57 with SMTP id j26-20020a63231a000000b0046b208f1e57mr14436687pgj.57.1666315380612; Thu, 20 Oct 2022 18:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666315380; cv=none; d=google.com; s=arc-20160816; b=XBnUZ8Pm7vZxFGc1gk+LnM2Ca6n2xrxaaZBJITDwwhAtJuNiI2gcm3iqarmAuEWaxM 3XLX4bHTj7sPdbssnNk5j8GfEUzLFgDAoWWcwU7o81wrfVPIM/3Yqt7lI3rdqqjxKIPD sfp4JL5/2jjdHtBhv4xVXlhHCzygVUvSWQ7e+OMq4bQWPrZbMN2aTrIn4GzFBJ2KyIFI KAOHZv83I9prVZHnblwUVDyOOBpXcRope8rviZUNybFMuvC0et57AWAO7Rh+IgTgvevQ v/PNOszm/dXCuyq/u3HZY7TpLVsdmnLx2hV8wRlD3kUAo0tCX0o89bikvuYDDBUPBZu+ nTwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=x9VVMGW8qoz42sndkXDX13AcOEczJvnXLKCYE5U8zYI=; b=KcIRLc+RExZY+suU5uCR2QtkXR5z1FC909XxZ8By6KiYYvEhkLvoi2O2XkQPJGxAYH Ri3aUAvIX1TtvcwmfIW4ppLn/d7+Qw5ctbcjDLoXLif2JB2CscOrc6AnYMfxEgtA7F0f 3jRqxZjmnP29YCP/e8zrtIGeja1OsKO2DE+DIzsT3uNjDIBYPlNuFOBYD7s7Jq+c5gr2 OITjuK4CdIpFzWlXNsli83zn2dNcZKQFMV9R+UbHvDeQmwpx6cyKyR2cdownw0w6gTKh jsjfDM2Lu2eWOrL8levKsCmdkf6IMk3v2QtGDNrD24ONmq6HsKhhjHh2u7IAfXmT1zu1 3rsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q138-20020a632a90000000b0042b807728e3si24229753pgq.762.2022.10.20.18.22.25; Thu, 20 Oct 2022 18:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbiJUBL5 (ORCPT + 99 others); Thu, 20 Oct 2022 21:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiJUBLz (ORCPT ); Thu, 20 Oct 2022 21:11:55 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72E8B233995; Thu, 20 Oct 2022 18:11:48 -0700 (PDT) Received: from dggpeml500020.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MtmZS6xMszDsHn; Fri, 21 Oct 2022 09:09:04 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 21 Oct 2022 09:11:45 +0800 Received: from localhost.localdomain (10.175.112.70) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 21 Oct 2022 09:11:45 +0800 From: Zhang Changzhong To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Crispin , Ralph Hempel , Ralf Baechle CC: Zhang Changzhong , , Subject: [PATCH net] net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY Date: Fri, 21 Oct 2022 09:32:24 +0800 Message-ID: <1666315944-30898-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747258316641911465?= X-GMAIL-MSGID: =?utf-8?q?1747258316641911465?= The ndo_start_xmit() method must not free skb when returning NETDEV_TX_BUSY, since caller is going to requeue freed skb. Fixes: 504d4721ee8e ("MIPS: Lantiq: Add ethernet driver") Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/lantiq_etop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c index 59aab40..f5961bd 100644 --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c @@ -485,7 +485,6 @@ ltq_etop_tx(struct sk_buff *skb, struct net_device *dev) len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len; if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) { - dev_kfree_skb_any(skb); netdev_err(dev, "tx ring full\n"); netif_tx_stop_queue(txq); return NETDEV_TX_BUSY;