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

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.com


Signed-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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2034,7 +2034,7 @@ static int irdma_create_cq(struct ib_cq *ibcq,
		/* Kmode allocations */
		int rsize;

		if (entries > rf->max_cqe) {
		if (entries < 1 || entries > rf->max_cqe) {
			err_code = -EINVAL;
			goto cq_free_rsrc;
		}