From: Serhat Kumral <serhatkumral1@gmail.com>
To: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org
Cc: Kaike Wan <kaike.wan@intel.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
linux-kernel@vger.kernel.org,
Serhat Kumral <serhatkumral1@gmail.com>
Subject: [PATCH] IB/rdmavt: Fix error unwind path for qp_priv_init() in rvt_create_qp()
Date: Thu, 15 Oct 2026 13:25:18 +0300 [thread overview]
Message-ID: <20261015102518.15780-1-serhatkumral1@gmail.com> (raw)
If driver_f.qp_priv_init() fails, execution jumps to bail_rq_wq, which
bypasses bail_qpn. Because alloc_qpn() has already succeeded at this point,
the allocated QP number is left unreleased.
Jump to bail_qpn instead to ensure the QPN is properly freed via
rvt_free_qpn().
Fixes: 5190f052a3654 ("IB/hfi1: Allow the driver to initialize QP priv struct")
Assisted-by: LLM
Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com>
---
found while investigating smatch warning:
- drivers/infiniband/sw/rdmavt/qp.c:1182 rvt_create_qp() warn: missing unwind goto?
drivers/infiniband/sw/rdmavt/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index d8ee485c49a6..3602b9ff2196 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1173,7 +1173,7 @@ int rvt_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
if (rdi->driver_f.qp_priv_init) {
ret = rdi->driver_f.qp_priv_init(rdi, qp, init_attr);
if (ret)
- goto bail_rq_wq;
+ goto bail_qpn;
}
break;
--
2.53.0
next reply other threads:[~2026-10-15 10:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 10:25 Serhat Kumral [this message]
2026-10-15 10:47 ` [PATCH] IB/rdmavt: Fix error unwind path for qp_priv_init() in rvt_create_qp() sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261015102518.15780-1-serhatkumral1@gmail.com \
--to=serhatkumral1@gmail.com \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=jgg@ziepe.ca \
--cc=kaike.wan@intel.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox