Skip to contentSkip to conversation

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

PATCH Applied Steen Hegelund 2 participants 2 messages Feb 2, 2022

Subsystems (3)
lore
Share & tools
lore

Steen Hegelund

author maintainer
#0 lore raw

PATCH v2 1/1 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.

---
 drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c +1 -1
index dc7e5ea6ec15..148d431fcde4 100644
@@ -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,

--
2.35.1

#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 2 Feb 2022 09:30:39 +0100 you wrote:

Do not try to use any SKB fields after the packet has been passed up in the receive stack.

[...]

Here is the summary with links:
- [net,v2] net: sparx5: do not refer to skb after passing it on

    https://git.kernel.org/netdev/net/c/81eb8b0b1878

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html