Commit 81eb8b0b authored by Steen Hegelund's avatar Steen Hegelund Committed by Jakub Kicinski

net: sparx5: do not refer to skb after passing it on

Do not try to use any SKB fields after the packet has been passed up in the
receive stack.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSteen Hegelund <steen.hegelund@microchip.com>
Link: https://lore.kernel.org/r/20220202083039.3774851-1-steen.hegelund@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c86d8613
...@@ -145,9 +145,9 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap) ...@@ -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); skb_put(skb, byte_cnt - ETH_FCS_LEN);
eth_skb_pad(skb); eth_skb_pad(skb);
skb->protocol = eth_type_trans(skb, netdev); skb->protocol = eth_type_trans(skb, netdev);
netif_rx(skb);
netdev->stats.rx_bytes += skb->len; netdev->stats.rx_bytes += skb->len;
netdev->stats.rx_packets++; netdev->stats.rx_packets++;
netif_rx(skb);
} }
static int sparx5_inject(struct sparx5 *sparx5, static int sparx5_inject(struct sparx5 *sparx5,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment