Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1539542imu; Wed, 28 Nov 2018 11:01:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/UMwRZQ0iN+pDiWPtPYv6xIenCmcwZH8usxM1JqESDPj/iHc/FlbMq0ykszUPsfw1r4bqVE X-Received: by 2002:a63:30c8:: with SMTP id w191mr35206195pgw.120.1543431687038; Wed, 28 Nov 2018 11:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543431687; cv=none; d=google.com; s=arc-20160816; b=JZbsXj5MT/6MaSI8xb/W0Oeztw7FKcwgV7TCi6Ol2nqlWS2JO7ZhOryYDvh0qpJ6u2 +H/ofVIhVvCcup8wYbvQDKasULt2YTyCBsV6W1QH5zsEIbuBI9N/r2SbDtTCEc4hNLKk bU0D/qvsIkuchbO5ZBfFqQMv/fMBRo+TWo24QzUkuOgSyfBpy8930imOOcYMeWyfbOqp IMSFva+QRp1F2IY1k1XSupnqUXbrgopbgZz2oX1/Ftnm7QTzSYGPhnU7i7mTulO3zeG4 c8vACYxb9E/2PGL6okkgEUxN5MxvKOSrqf4+ngd4NlFcFTXnTgHBKLCi6H2TsMMaIW/S olFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=7GgSAVH8YQKhUF7EuG7rXn1BrV7t+U+fECKeDHNfdNY=; b=M7FPiuHffmFZGq3V84X/WsqWECxnjY3DzkPszEvnWPDRcb7t0k/jvoD7DFn9571ArF kuztSqtJF4eLzMga6kOLIx8gT52A/ehq4cmM6LTJG0+YF7tfvQ0P0QCg1azpWXb2fhlV 7dR2p0dz0heIk+ukaTEdpupRoyxB0GCy3AZhE7l1CO0NOWJMiZ7ggcOXuSoYrXObNaFI 3KFW3TpihGwwk3cNs15PlInfBEZcjGU63hclrhWVaUKtNA6qPqMJBVS3KvgL07QDtCz8 GLUOjgWanMTJx+wwfBY9jxbvCchYFkIKEKDxFRKZqpnRyTWurAspWh5RHLH1tzOvMeW+ 9mTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si8251032pgr.500.2018.11.28.11.01.11; Wed, 28 Nov 2018 11:01:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729179AbeK2GBp (ORCPT + 99 others); Thu, 29 Nov 2018 01:01:45 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:36392 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbeK2GBp (ORCPT ); Thu, 29 Nov 2018 01:01:45 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id EFDAE14E0ECFF; Wed, 28 Nov 2018 10:59:06 -0800 (PST) Date: Wed, 28 Nov 2018 10:59:06 -0800 (PST) Message-Id: <20181128.105906.2127945279482643879.davem@davemloft.net> To: bianpan2016@163.com Cc: Jose.Abreu@synopsys.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: dwc-xlgmac: set skb to NULL after freeing it From: David Miller In-Reply-To: <1543396853-35188-1-git-send-email-bianpan2016@163.com> References: <1543396853-35188-1-git-send-email-bianpan2016@163.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 28 Nov 2018 10:59:07 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian Date: Wed, 28 Nov 2018 17:20:53 +0800 > @@ -1180,6 +1180,7 @@ static int xlgmac_rx_poll(struct xlgmac_channel *channel, int budget) > netif_err(pdata, rx_err, netdev, > "error in received packet\n"); > dev_kfree_skb(skb); > + skb = NULL; > goto next_packet; > } > > @@ -1227,6 +1228,7 @@ static int xlgmac_rx_poll(struct xlgmac_channel *channel, int budget) > netif_err(pdata, rx_err, netdev, > "packet length exceeds configured MTU\n"); > dev_kfree_skb(skb); > + skb = NULL; > goto next_packet; > } Same problem as your amd-xgbe patch, the condition you say can occurr is actually impossible.