diff options
author | Steen Hegelund <steen.hegelund@microchip.com> | 2022-02-02 11:30:39 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-02 20:07:22 +0300 |
commit | 81eb8b0b18789e647e65579303529fd52d861cc2 (patch) | |
tree | 6f1fa43d19e90381dc0b6cbbf36ee53f1bfd2366 /drivers/net/ethernet | |
parent | c86d86131ab75696fc52d98571148842e067d620 (diff) | |
download | linux-81eb8b0b18789e647e65579303529fd52d861cc2.tar.xz |
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: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Link: https://lore.kernel.org/r/20220202083039.3774851-1-steen.hegelund@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |