Commit f4475f24 authored by Sindhu Devale's avatar Sindhu Devale Committed by Jason Gunthorpe

RDMA/irdma: Validate number of CQ entries on create CQ

Add lower bound check for CQ entries at creation time.

Fixes: b48c24c2 ("RDMA/irdma: Implement device supported verb APIs")
Link: https://lore.kernel.org/r/20210916191222.824-3-shiraz.saleem@intel.comSigned-off-by: default avatarSindhu Devale <sindhu.devale@intel.com>
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 5b1e985f
...@@ -2034,7 +2034,7 @@ static int irdma_create_cq(struct ib_cq *ibcq, ...@@ -2034,7 +2034,7 @@ static int irdma_create_cq(struct ib_cq *ibcq,
/* Kmode allocations */ /* Kmode allocations */
int rsize; int rsize;
if (entries > rf->max_cqe) { if (entries < 1 || entries > rf->max_cqe) {
err_code = -EINVAL; err_code = -EINVAL;
goto cq_free_rsrc; goto cq_free_rsrc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment