RDMA/qedr: Fix use of uninitialized field
authorMichal Kalderon <michal.kalderon@marvell.com>
Wed, 2 Sep 2020 16:57:36 +0000 (19:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:07:09 +0000 (09:07 +0100)
[ Upstream commit a379ad54e55a12618cae7f6333fd1b3071de9606 ]

dev->attr.page_size_caps was used uninitialized when setting device
attributes

Fixes: ec72fce401c6 ("qedr: Add support for RoCE HW init")
Link: https://lore.kernel.org/r/20200902165741.8355-4-michal.kalderon@marvell.com
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/qedr/main.c

index 3e48ed64760b72801ab5ac02771110b469f6740f..8c9e23d1f434e50ab5f6c6b240a5636241ba3748 100644 (file)
@@ -548,7 +548,7 @@ static int qedr_set_device_attr(struct qedr_dev *dev)
        qed_attr = dev->ops->rdma_query_device(dev->rdma_ctx);
 
        /* Part 2 - check capabilities */
-       page_size = ~dev->attr.page_size_caps + 1;
+       page_size = ~qed_attr->page_size_caps + 1;
        if (page_size > PAGE_SIZE) {
                DP_ERR(dev,
                       "Kernel PAGE_SIZE is %ld which is smaller than minimum page size (%d) required by qedr\n",