From c47b170b024060e1b62ba211fe6fcd66fb36af4a Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 2 Dec 2019 14:22:55 +0000 Subject: [PATCH] mlx5: Do not try to enable fwdumps if scan space did not responded. Sponsored by: Mellanox Technologies MFC after: 1 week --- sys/dev/mlx5/mlx5_core/mlx5_fwdump.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c b/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c index 37faa46d4c19..622ea7ae0cdb 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c @@ -111,6 +111,10 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) sz++; addr = next_addr; } + if (sz == 1) { + mlx5_core_warn(mdev, "no output from scan space\n"); + goto unlock_vsc; + } mdev->dump_rege = malloc(sz * sizeof(struct mlx5_crspace_regmap), M_MLX5_DUMP, M_WAITOK | M_ZERO);