Skip to content

Commit c712654

Browse files
Binary-Eatergregkh
authored andcommitted
net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe
commit 64f14d1 upstream. When SQ is a port timestamping SQ for PTP, do not access tx flags of skb after free-ing the skb. Free the skb only after all references that depend on it have been handled in the dropped WQE path. Fixes: 3178308 ("net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs") Signed-off-by: Rahul Rameshbabu <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2c9de86 commit c712654

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ mlx5e_sq_xmit_wqe(struct mlx5e_txqsq *sq, struct sk_buff *skb,
494494

495495
err_drop:
496496
stats->dropped++;
497-
dev_kfree_skb_any(skb);
498497
if (unlikely(sq->ptpsq && (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)))
499498
mlx5e_ptp_metadata_fifo_push(&sq->ptpsq->metadata_freelist,
500499
be32_to_cpu(eseg->flow_table_metadata));
500+
dev_kfree_skb_any(skb);
501501
mlx5e_tx_flush(sq);
502502
}
503503

0 commit comments

Comments
 (0)