]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
i40iw: Use sqsize to initialize cqp_requests elements
authorChien Tin Tung <chien.tin.tung@intel.com>
Fri, 8 Dec 2017 20:34:28 +0000 (14:34 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 11 Dec 2017 23:19:43 +0000 (16:19 -0700)
Use sqsize instead of I40IW_CQP_SW_SQSIZE_2048 to initialize
cqp_requests elements in the for-loop as sqsize is used
to allocate memory for cqp_requests.

Signed-off-by: Chien Tin Tung <chien.tin.tung@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/i40iw/i40iw_main.c

index e824296713e2620941348e7340af6b9a3580afbe..1f9d9c77d8ce97f9332cb3e9e5e166bf94bc5a17 100644 (file)
@@ -607,7 +607,7 @@ static enum i40iw_status_code i40iw_create_cqp(struct i40iw_device *iwdev)
        INIT_LIST_HEAD(&cqp->cqp_avail_reqs);
        INIT_LIST_HEAD(&cqp->cqp_pending_reqs);
        /* init the waitq of the cqp_requests and add them to the list */
-       for (i = 0; i < I40IW_CQP_SW_SQSIZE_2048; i++) {
+       for (i = 0; i < sqsize; i++) {
                init_waitqueue_head(&cqp->cqp_requests[i].waitq);
                list_add_tail(&cqp->cqp_requests[i].list, &cqp->cqp_avail_reqs);
        }