mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
RDMA/cxgb4: Validate the number of CQEs
[ Upstream commit6d8285e604] Before create CQ, make sure that the requested number of CQEs is in the supported range. Fixes:cfdda9d764("RDMA/cxgb4: Add driver for Chelsio T4 RNIC") Link: https://lore.kernel.org/r/20201108132007.67537-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c3c96c2b4b
commit
0b2f0afa3d
@@ -1012,6 +1012,9 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
|
||||
|
||||
rhp = to_c4iw_dev(ibdev);
|
||||
|
||||
if (entries < 1 || entries > ibdev->attrs.max_cqe)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (vector >= rhp->rdev.lldi.nciq)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user