Skip to content

Commit 81eb8b0

Browse files
steen-hegelund-mchpkuba-moo
authored andcommitted
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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Steen Hegelund <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c86d861 commit 81eb8b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_packet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap)
145145
skb_put(skb, byte_cnt - ETH_FCS_LEN);
146146
eth_skb_pad(skb);
147147
skb->protocol = eth_type_trans(skb, netdev);
148-
netif_rx(skb);
149148
netdev->stats.rx_bytes += skb->len;
150149
netdev->stats.rx_packets++;
150+
netif_rx(skb);
151151
}
152152

153153
static int sparx5_inject(struct sparx5 *sparx5,

0 commit comments

Comments
 (0)