diff options
author | Sindhu Devale <sindhu.devale@intel.com> | 2021-09-16 21:12:20 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-09-20 19:13:23 +0200 |
commit | f4475f249445b3c1fb99919b0514a075b6d6b3d4 (patch) | |
tree | e4d3f0e3689f8cf5bf5f7281ba63e527b8f7e187 /drivers/infiniband | |
parent | RDMA/irdma: Skip CQP ring during a reset (diff) | |
download | linux-f4475f249445b3c1fb99919b0514a075b6d6b3d4.tar.xz linux-f4475f249445b3c1fb99919b0514a075b6d6b3d4.zip |
RDMA/irdma: Validate number of CQ entries on create CQ
Add lower bound check for CQ entries at creation time.
Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Link: https://lore.kernel.org/r/20210916191222.824-3-shiraz.saleem@intel.com
Signed-off-by: Sindhu Devale <sindhu.devale@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/irdma/verbs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 829ddfa7e144..23c47482c749 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -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; } |