Skip to contentSkip to conversation

RDMA/cxgb4: Validate the number of CQEs

PATCH Applied Kamal Heib 2 participants 2 messages Nov 8, 2020 – Nov 23, 2020

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/cxgb4: Validate the number of CQEs

Before create CQ, make sure that the requested number of CQEs is in the supported range.

Fixes cfdda9d76436 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
---
 drivers/infiniband/hw/cxgb4/cq.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/infiniband/hw/cxgb4/cq.c +3 -0
index 2cb65be24770..44c2416588d4 100644
@@ -1008,6 +1008,9 @@ int c4iw_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
 	if (attr->flags)
 		return -EOPNOTSUPP;
 
+	if (entries < 1 || entries > ibdev->attrs.max_cqe)
+		return -EINVAL;
+
 	if (vector >= rhp->rdev.lldi.nciq)
 		return -EINVAL;
 
Signature · 1 line
2.26.2
maintainer Applied
#1 lore raw
Quoted 8 lines · Kamal Heib

Before create CQ, make sure that the requested number of CQEs is in the supported range.

Fixes cfdda9d76436 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
---
 drivers/infiniband/hw/cxgb4/cq.c | 3 +++
 1 file changed, 3 insertions(+)

Applied to for-next, thanks

Jason