net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe
authorRahul Rameshbabu <rrameshbabu@nvidia.com>
Tue, 14 Nov 2023 21:58:40 +0000 (13:58 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:19:53 +0000 (17:19 +0000)
commit3bc1967ddaac54323be664649e50e3e2618baadb
tree74cce7356a3f817a5440626f74d5c9433d7c6a5d
parentf676cc90ad0f08f7c959ea625a7e2143a36f5c66
net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe

[ Upstream commit 64f14d16eef1f939000f2617b50c7c996b5117d4 ]

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: 3178308ad4ca ("net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs")
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20231114215846.5902-10-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c