mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
net/mlx5: Collect command failures data only for known commands
commit2a0a935fb6upstream. 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:34f46ae0d4("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
390aa5c006
commit
411e4d6caa
@@ -1894,9 +1894,10 @@ static void mlx5_cmd_err_trace(struct mlx5_core_dev *dev, u16 opcode, u16 op_mod
|
|||||||
static void cmd_status_log(struct mlx5_core_dev *dev, u16 opcode, u8 status,
|
static void cmd_status_log(struct mlx5_core_dev *dev, u16 opcode, u8 status,
|
||||||
u32 syndrome, int err)
|
u32 syndrome, int err)
|
||||||
{
|
{
|
||||||
|
const char *namep = mlx5_command_str(opcode);
|
||||||
struct mlx5_cmd_stats *stats;
|
struct mlx5_cmd_stats *stats;
|
||||||
|
|
||||||
if (!err)
|
if (!err || !(strcmp(namep, "unknown command opcode")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stats = &dev->cmd.stats[opcode];
|
stats = &dev->cmd.stats[opcode];
|
||||||
|
|||||||
Reference in New Issue
Block a user