In the case that the reported max number of QPs capability
equals to zero, abort FPGA init.
Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Signed-off-by: Adi Nissim <adin@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
                       MLX5_CAP_FPGA(fdev->mdev, sandbox_product_version));
 
        max_num_qps = MLX5_CAP_FPGA(mdev, shell_caps.max_num_qps);
+       if (!max_num_qps) {
+               mlx5_fpga_err(fdev, "FPGA reports 0 QPs in SHELL_CAPS\n");
+               err = -ENOTSUPP;
+               goto out;
+       }
+
        err = mlx5_core_reserve_gids(mdev, max_num_qps);
        if (err)
                goto out;