IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
[linux-2.6-block.git] / drivers / net / ethernet / mellanox / mlx4 / qp.c
index 769598f7b6c87eb83540c88678570869e6ca8d26..3aaf4bad6c5a5bd7cbdf111a8f6411697a3b4289 100644 (file)
@@ -287,6 +287,9 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt)
        u64 in_param = 0;
        int err;
 
+       if (!cnt)
+               return;
+
        if (mlx4_is_mfunc(dev)) {
                set_param_l(&in_param, base_qpn);
                set_param_h(&in_param, cnt);