Skip to content

Commit eb867d7

Browse files
committed
RDMA/bnxt_re: Remove always true dattr validity check
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: 07f830a ("RDMA/bnxt_re: Adds MSN table capability for Gen P7 adapters") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Link: https://patch.msgid.link/be0d8836b64cba3e479fbcbca717acad04aae02e.1732626579.git.leonro@nvidia.com Acked-by: Selvin Xavier <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 40384c8 commit eb867d7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,9 +1000,7 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)
10001000
u32 tbl_indx;
10011001
u16 nsge;
10021002

1003-
if (res->dattr)
1004-
qp->is_host_msn_tbl = _is_host_msn_table(res->dattr->dev_cap_flags2);
1005-
1003+
qp->is_host_msn_tbl = _is_host_msn_table(res->dattr->dev_cap_flags2);
10061004
sq->dbinfo.flags = 0;
10071005
bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req,
10081006
CMDQ_BASE_OPCODE_CREATE_QP,

0 commit comments

Comments
 (0)