diff options
author | Natalia Petrova <n.petrova@fintech.ru> | 2023-03-03 13:44:08 +0100 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-03-14 10:57:01 +0100 |
commit | b73a0b80c69de77d8d4942abb37066531c0169b2 (patch) | |
tree | 1a9dc214c0d22486b66b230070319e39341d0bb1 /drivers/infiniband/sw/rdmavt/qp.c | |
parent | IB/rdmavt: Fix target union member for rvt_post_one_wr() (diff) | |
download | linux-b73a0b80c69de77d8d4942abb37066531c0169b2.tar.xz linux-b73a0b80c69de77d8d4942abb37066531c0169b2.zip |
RDMA/rdmavt: Delete unnecessary NULL check
There is no need to check 'rdi->qp_dev' for NULL. The field 'qp_dev'
is created in rvt_register_device() which will fail if the 'qp_dev'
allocation fails in rvt_driver_qp_init(). Overwise this pointer
doesn't changed and passed to rvt_qp_exit() by the next step.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 0acb0cc7ecc1 ("IB/rdmavt: Initialize and teardown of qpn table")
Signed-off-by: Natalia Petrova <n.petrova@fintech.ru>
Link: https://lore.kernel.org/r/20230303124408.16685-1-n.petrova@fintech.ru
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/sw/rdmavt/qp.c')
-rw-r--r-- | drivers/infiniband/sw/rdmavt/qp.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index 3f707e1fa517..2d143a9d2027 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -464,8 +464,6 @@ void rvt_qp_exit(struct rvt_dev_info *rdi) if (qps_inuse) rvt_pr_err(rdi, "QP memory leak! %u still in use\n", qps_inuse); - if (!rdi->qp_dev) - return; kfree(rdi->qp_dev->qp_table); free_qpn_table(&rdi->qp_dev->qpn_table); |