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: 0acb0cc7ec ("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>
This commit is contained in:
Natalia Petrova 2023-03-03 15:44:08 +03:00 коммит произвёл Leon Romanovsky
Родитель f2f6e1661d
Коммит b73a0b80c6
1 изменённых файлов: 0 добавлений и 2 удалений

Просмотреть файл

@ -464,8 +464,6 @@ void rvt_qp_exit(struct rvt_dev_info *rdi)
if (qps_inuse) if (qps_inuse)
rvt_pr_err(rdi, "QP memory leak! %u still in use\n", rvt_pr_err(rdi, "QP memory leak! %u still in use\n",
qps_inuse); qps_inuse);
if (!rdi->qp_dev)
return;
kfree(rdi->qp_dev->qp_table); kfree(rdi->qp_dev->qp_table);
free_qpn_table(&rdi->qp_dev->qpn_table); free_qpn_table(&rdi->qp_dev->qpn_table);