aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4
diff options
context:
space:
mode:
authorGuy Levi <guyle@mellanox.com>2017-08-17 15:50:49 +0300
committerDoug Ledford <dledford@redhat.com>2017-08-24 16:27:11 -0400
commitf9bfea992e7d7557c40a58e8536ad8c6f177de25 (patch)
tree50c7e001203507873170255b22697aae65f6a9c9 /drivers/infiniband/hw/mlx4
parentIB/mlx4: Remove redundant attribute in mlx4_ib_create_qp_rss struct (diff)
downloadlinux-dev-f9bfea992e7d7557c40a58e8536ad8c6f177de25.tar.xz
linux-dev-f9bfea992e7d7557c40a58e8536ad8c6f177de25.zip
IB/mlx4: Check that reserved fields in mlx4_ib_create_qp_rss are zero
According to mlx4 convention, need to fail the command due to a non-zero value in the user data which is expected to be zero. Fixes: 3078f5f1bd8b ("IB/mlx4: Add support for RSS QP") Signed-off-by: Guy Levi <guyle@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index c3958fcfed75..1ac148ddb250 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -812,6 +812,9 @@ static struct ib_qp *_mlx4_ib_create_qp_rss(struct ib_pd *pd,
return ERR_PTR(-EFAULT);
}
+ if (memchr_inv(ucmd.reserved, 0, sizeof(ucmd.reserved)))
+ return ERR_PTR(-EOPNOTSUPP);
+
if (ucmd.comp_mask || ucmd.reserved1)
return ERR_PTR(-EOPNOTSUPP);