]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: Collect command failures data only for known commands
authorShay Drory <shayd@nvidia.com>
Tue, 2 May 2023 08:03:53 +0000 (11:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:28 +0000 (14:17 +0100)
commitd8b6f175235d7327b4e1b13216859e89496dfbd5
treecda05b2cdcc1dff21e3a1c6b31d3a375e8a73af2
parent8eea2945365059f1cdc715a849afcbbd11e82e30
net/mlx5: Collect command failures data only for known commands

commit 2a0a935fb64ee8af253b9c6133bb6702fb152ac2 upstream.

DEVX can issue a general command, which is not used by mlx5 driver.
In case such command is failed, mlx5 is trying to collect the failure
data, However, mlx5 doesn't create a storage for this command, since
mlx5 doesn't use it. This lead to array-index-out-of-bounds error.

Fix it by checking whether the command is known before collecting the
failure data.

Fixes: 34f46ae0d4b3 ("net/mlx5: Add command failures data to debugfs")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c