RDMA/cxgb4: Validate the number of CQEs
Subsystems (2)
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")
Signed-off-by Kamal Heib <[email protected]>
--- drivers/infiniband/hw/cxgb4/cq.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/hw/cxgb4/cq.c +3 -0
@@ -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
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")Signed-off-by Kamal Heib <[email protected]>--- drivers/infiniband/hw/cxgb4/cq.c | 3 +++ 1 file changed, 3 insertions(+)
Applied to for-next, thanks
Jason