mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 08:31:55 +00:00
IB/mlx5: Fix entries checks in mlx5_ib_create_cq
Number of entries shouldn't be greater than the device's max
capability. This should be checked before rounding the entries number
to power of two.
Fixes: 51ee86a4af
('IB/mlx5: Fix check of number of entries...')
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
2cc6ad5f21
commit
9ea5785286
@ -822,7 +822,8 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
|
|||||||
int eqn;
|
int eqn;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (entries < 0)
|
if (entries < 0 ||
|
||||||
|
(entries > (1 << MLX5_CAP_GEN(dev->mdev, log_max_cq_sz))))
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
if (check_cq_create_flags(attr->flags))
|
if (check_cq_create_flags(attr->flags))
|
||||||
|
Loading…
Reference in New Issue
Block a user