Re: [PATCH] net: dwc-xlgmac: set skb to NULL after freeing it

From: David Miller
Date: Wed Nov 28 2018 - 13:59:09 EST


From: Pan Bian <bianpan2016@xxxxxxx>
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.