]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Don't use already freed action pointer
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 24 May 2022 12:59:27 +0000 (15:59 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 31 May 2022 20:40:53 +0000 (13:40 -0700)
commit56cb32367c4497de81baa2026ea1d9bbf9f1c81f
tree405ec9d5f2ddc2ba905f8d160cccca416e0eb6b6
parentf7b43056d250d4ebaf4a22a5303160a3392d2b00
net/mlx5: Don't use already freed action pointer

The call to mlx5dr_action_destroy() releases "action" memory. That
pointer is set to miss_action later and generates the following smatch
error:

 drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c:53 set_miss_action()
 warn: 'action' was already freed.

Make sure that the pointer is always valid by setting NULL after destroy.

Fixes: c9acd6ebd843 ("net/mlx5: Add direct rule fs_cmd implementation")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c