diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2014-01-15 07:56:44 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-01-23 02:23:54 -0500 |
commit | 57761d8df8efc7cc1227f9bc22e0dda01b0dd91b (patch) | |
tree | 0b06de67513b07eb444a5fc735ec727959bc3d87 /drivers/infiniband | |
parent | 8c8a49148b95c4d7c5f58a6866a30ea02485d7a3 (diff) |
IB/mlx5: Verify reserved fields are cleared
Verify that reserved fields in struct mlx5_ib_resize_cq are cleared
before continuing execution of the verb. This is required to allow
making use of this area in future revisions.
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx5/cq.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 50b03a8067e5..b1705ce6eb88 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c | |||
@@ -877,8 +877,12 @@ static int resize_user(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq, | |||
877 | int npages; | 877 | int npages; |
878 | struct ib_ucontext *context = cq->buf.umem->context; | 878 | struct ib_ucontext *context = cq->buf.umem->context; |
879 | 879 | ||
880 | if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) | 880 | err = ib_copy_from_udata(&ucmd, udata, sizeof(ucmd)); |
881 | return -EFAULT; | 881 | if (err) |
882 | return err; | ||
883 | |||
884 | if (ucmd.reserved0 || ucmd.reserved1) | ||
885 | return -EINVAL; | ||
882 | 886 | ||
883 | umem = ib_umem_get(context, ucmd.buf_addr, entries * ucmd.cqe_size, | 887 | umem = ib_umem_get(context, ucmd.buf_addr, entries * ucmd.cqe_size, |
884 | IB_ACCESS_LOCAL_WRITE, 1); | 888 | IB_ACCESS_LOCAL_WRITE, 1); |