From patchwork Wed Feb 2 08:30:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 12732706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6A95C433F5 for ; Wed, 2 Feb 2022 08:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zxGRgfOBsJQoZQ/BJtdSkvYTm3EtMoM2+lOBNwvdGEw=; b=XhwJLUZ6fMBNO6 fzpwvKXZSDl0KcqDpF+vM7YzWWrf4Ld4a/qAeCfqQ24H5X7iQAyYkTdNa00RaBtmXtqoa3CkFwhI7 wkOozPdpDbWJHJfvHdZYxq+8Z09nCa++fLHGetBH9L8TeC0Dlrh66IXAk04jla4uIfaQ0cZ7TNbRH 2LbdAWaEWv7R96/zvsAUj2Dc0NUHKIQKabdEc+08HKGMcq0Ks+6jqYm1yYvWF4+lun4yFif1Gg33C zAbBxDwq9E/orrr/UX8B525ML5L3vdQZi46v+/kcwW7lvWsivShOUzuUKQJE5qH4c5m4v1UUTwRI6 hqJGQNuZ+RZNPtqAQmmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFB3A-00Eawg-Ou; Wed, 02 Feb 2022 08:31:36 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFB36-00Eav6-RK for linux-arm-kernel@lists.infradead.org; Wed, 02 Feb 2022 08:31:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1643790692; x=1675326692; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=u+DzTfKMjcecMARYYAmOWUUJ2SW4bIwLVPvUzcWVG28=; b=CTZkczvN5tjQIKL0xBYgmKX1XQSlO4DtElcdKjD16Fdj4fCMDhaWsoGj kGblzgZM9z4t3qRBpwizC5lRjLBx4SsS5UFhwVXlJFtNMwZH7d7xb5fnX yY1g6pbV+Ff8mNqrqdkhiaaXM+rmNtJjzQmgtY2a3mHdqLltSS3rJbjyR S9O/1vXb1uSlq35CxJRMKwpVC5VQb9FezfYcLF/Wo3bNuKB2TugLmQfBR RMHjc9j2vtcZ6og84uDYQFdHycEbMx/WdeW14W2gkQJQqHEcBatGJGwCU zabTwsQMcE4K46DoN8pIrjhUJVH2kT3c+T66yNdj5hIs8UZ1+nX01eYhA g==; IronPort-SDR: HrLsfAkEaxHvnyiqLFs4XJ7ooFesl42N5wt1tF6vC/8NT++lDk5ThMENLLj6tzh3Krhlf6E5QY 7Iht3eBe/C8hhI08nt2Mxaj8mpF6UJxE1dcBh/ljtEUrNHTDmkoDKBmGqgG8nRL45x7Ud4FdC/ Ry8S7bRHE0UqrenG0XodLT5DOkeUJdmFR0v0CtVc6Y3TyqUA2g+SIpzQA1EGVmzgfWz3fNcXQs 4JQyRSPp4KlSA30fWKc97Eg1UGfPeocs+Mzz6sBPBnWsunlbxC6JmwsBBBOlngffzHWmHdIDBa OWFVdfXglwmojel2EnKFTTfQ X-IronPort-AV: E=Sophos;i="5.88,336,1635231600"; d="scan'208";a="84413464" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Feb 2022 01:31:31 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 2 Feb 2022 01:31:31 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 2 Feb 2022 01:31:30 -0700 From: Steen Hegelund To: "David S. Miller" , Jakub Kicinski , , , , , "Dan Carpenter" CC: Steen Hegelund , kernel test robot Subject: [PATCH net v2] net: sparx5: do not refer to skb after passing it on Date: Wed, 2 Feb 2022 09:30:39 +0100 Message-ID: <20220202083039.3774851-1-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220202_003132_980804_C9C4B9B9 X-CRM114-Status: GOOD ( 10.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Do not try to use any SKB fields after the packet has been passed up in the receive stack. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Steen Hegelund --- drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.35.1 diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c index dc7e5ea6ec15..148d431fcde4 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c @@ -145,9 +145,9 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap) skb_put(skb, byte_cnt - ETH_FCS_LEN); eth_skb_pad(skb); skb->protocol = eth_type_trans(skb, netdev); - netif_rx(skb); netdev->stats.rx_bytes += skb->len; netdev->stats.rx_packets++; + netif_rx(skb); } static int sparx5_inject(struct sparx5 *sparx5,