lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 106/242] RDMA/cxgb4: Validate the number of CQEs
    Date
    From: Kamal Heib <kamalheib1@gmail.com>

    [ Upstream commit 6d8285e604e0221b67bd5db736921b7ddce37d00 ]

    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")
    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/infiniband/hw/cxgb4/cq.c | 3 +++
    1 file changed, 3 insertions(+)

    --- a/drivers/infiniband/hw/cxgb4/cq.c
    +++ b/drivers/infiniband/hw/cxgb4/cq.c
    @@ -906,6 +906,9 @@ struct ib_cq *c4iw_create_cq(struct ib_d

    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);


    \
     
     \ /
      Last update: 2020-12-28 14:40    [W:5.239 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site