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>
This commit is contained in:
Родитель
8c8a49148b
Коммит
57761d8df8
|
@ -877,8 +877,12 @@ static int resize_user(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
|
||||||
int npages;
|
int npages;
|
||||||
struct ib_ucontext *context = cq->buf.umem->context;
|
struct ib_ucontext *context = cq->buf.umem->context;
|
||||||
|
|
||||||
if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd)))
|
err = ib_copy_from_udata(&ucmd, udata, sizeof(ucmd));
|
||||||
return -EFAULT;
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
if (ucmd.reserved0 || ucmd.reserved1)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
umem = ib_umem_get(context, ucmd.buf_addr, entries * ucmd.cqe_size,
|
umem = ib_umem_get(context, ucmd.buf_addr, entries * ucmd.cqe_size,
|
||||||
IB_ACCESS_LOCAL_WRITE, 1);
|
IB_ACCESS_LOCAL_WRITE, 1);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче