]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix handling of entry refcount when command is not issued to FW
authorMoshe Shemesh <moshe@nvidia.com>
Thu, 17 Nov 2022 07:07:20 +0000 (09:07 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 22 Nov 2022 02:14:34 +0000 (18:14 -0800)
commitb037fe0df0ed7ad5156e074edee159c61376dcdf
tree73588cb38c88042c531b24eb8ce70db26fba5914
parenta090bc7f31a4dabf8597b3f425d449588148672e
net/mlx5: Fix handling of entry refcount when command is not issued to FW

In case command interface is down, or the command is not allowed, driver
did not increment the entry refcount, but might have decrement as part
of forced completion handling.

Fix that by always increment and decrement the refcount to make it
symmetric for all flows.

Fixes: c9bf91832346 ("net/mlx5: Avoid possible free of command entry while timeout comp handler")
Signed-off-by: Eran Ben Elisha <eranbe@nvidia.com>
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reported-by: Jack Wang <jinpu.wang@ionos.com>
Tested-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c