]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Remove always true dattr validity check
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 26 Nov 2024 13:10:31 +0000 (15:10 +0200)
committerLeon Romanovsky <leon@kernel.org>
Wed, 4 Dec 2024 13:55:09 +0000 (08:55 -0500)
res->dattr is always valid at this point as it was initialized
during device addition in bnxt_re_add_device().

This change is fixing the following smatch error:
drivers/infiniband/hw/bnxt_re/qplib_fp.c:1090 bnxt_qplib_create_qp()
     error: we previously assumed 'res->dattr' could be null (see line 985)

Fixes: 07f830ae4913 ("RDMA/bnxt_re: Adds MSN table capability for Gen P7 adapters")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202411222329.YTrwonWi-lkp@intel.com/
Link: https://patch.msgid.link/be0d8836b64cba3e479fbcbca717acad04aae02e.1732626579.git.leonro@nvidia.com
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/infiniband/hw/bnxt_re/qplib_fp.c

index e42abf5be6c0f595cca2af72fda7ea08df9056ba..9af8aaadc99a86e2eee4dd1d27fef72321f807ec 100644 (file)
@@ -1000,9 +1000,7 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
        u32 tbl_indx;
        u16 nsge;
 
-       if (res->dattr)
-               qp->is_host_msn_tbl = _is_host_msn_table(res->dattr->dev_cap_flags2);
-
+       qp->is_host_msn_tbl = _is_host_msn_table(res->dattr->dev_cap_flags2);
        sq->dbinfo.flags = 0;
        bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req,
                                 CMDQ_BASE_OPCODE_CREATE_QP,