From: Prashant Kamble <prashant.kamble223@gmail.com>
Cc: prashant.kamble223@gmail.com,
Neil Armstrong <neil.armstrong@linaro.org>,
Bin Meng <bmeng.cn@gmail.com>, Tom Rini <trini@konsulko.com>,
Andrew Goodbody <andrew.goodbody@linaro.org>,
u-boot@lists.denx.de
Subject: [PATCH] nvme: avoid deleting uncreated queues
Date: Sun, 24 May 2026 21:17:14 +0530 [thread overview]
Message-ID: <20260524154718.16381-1-prashant.kamble223@gmail.com> (raw)
nvme_create_queue() may issue Delete CQ or Delete SQ
commands even when the corresponding queue creation
failed.
Avoid sending delete commands for queues that were never
successfully created.
Signed-off-by: Prashant Kamble <prashant.kamble223@gmail.com>
---
drivers/nvme/nvme.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index 9df7824b1c5..980ca919632 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -298,11 +298,6 @@ static int nvme_delete_queue(struct nvme_dev *dev, u8 opcode, u16 id)
return nvme_submit_admin_cmd(dev, &c, NULL);
}
-static int nvme_delete_sq(struct nvme_dev *dev, u16 sqid)
-{
- return nvme_delete_queue(dev, nvme_admin_delete_sq, sqid);
-}
-
static int nvme_delete_cq(struct nvme_dev *dev, u16 cqid)
{
return nvme_delete_queue(dev, nvme_admin_delete_cq, cqid);
@@ -563,20 +558,19 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid)
nvmeq->cq_vector = qid - 1;
result = nvme_alloc_cq(dev, qid, nvmeq);
if (result < 0)
- goto release_cq;
+ goto release_ret;
result = nvme_alloc_sq(dev, qid, nvmeq);
if (result < 0)
- goto release_sq;
+ goto release_cq;
nvme_init_queue(nvmeq, qid);
return result;
- release_sq:
- nvme_delete_sq(dev, qid);
release_cq:
nvme_delete_cq(dev, qid);
+ release_ret:
return result;
}
--
2.43.0
next reply other threads:[~2026-05-24 23:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-24 15:47 Prashant Kamble [this message]
2026-05-26 7:02 ` [PATCH] nvme: avoid deleting uncreated queues Neil Armstrong
2026-06-03 16:22 ` Neil Armstrong
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=20260524154718.16381-1-prashant.kamble223@gmail.com \
--to=prashant.kamble223@gmail.com \
--cc=andrew.goodbody@linaro.org \
--cc=bmeng.cn@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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