]> git.proxmox.com Git - mirror_ubuntu-kernels.git/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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 09:38:14 +0000 (11:38 +0200)
commitc01061908ed8f90a14b1c32da945a34594d50bba
treefc41e2cc3dc9c2563e6ba53242ba069391c292ce
parent26dee749c8c3cfbc9fae3b2544c98fcc0bea9af9
net/mlx5: Collect command failures data only for known commands

BugLink: https://bugs.launchpad.net/bugs/2028979
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c