summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatalia Petrova <n.petrova@fintech.ru>2023-03-03 15:44:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-17 11:11:45 +0200
commitdee13645fc3b5779378148629f1d31ab89144efe (patch)
tree69903ceef1b297cf46d2b96192f6b834001ff7be
parent2370d3065c9bd64620be0c1763c3afefe98fb349 (diff)
downloadlinux-stable-dee13645fc3b5779378148629f1d31ab89144efe.tar.gz
linux-stable-dee13645fc3b5779378148629f1d31ab89144efe.tar.bz2
linux-stable-dee13645fc3b5779378148629f1d31ab89144efe.zip
RDMA/rdmavt: Delete unnecessary NULL check
[ Upstream commit b73a0b80c69de77d8d4942abb37066531c0169b2 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/infiniband/sw/rdmavt/qp.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index b0309876f4bb..2bfcd47b58ba 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -318,8 +318,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);