public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: nvmet_sq_init(): fix use of uninitialized variable
@ 2025-05-09 23:59 Wilfred Mallawa
  2025-05-10  0:10 ` Keith Busch
  2025-05-12  5:24 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Wilfred Mallawa @ 2025-05-09 23:59 UTC (permalink / raw)
  To: linux-nvme
  Cc: linux-kernel, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Damien Le Moal, Alistair Francis,
	Wilfred Mallawa, kernel test robot

From: Wilfred Mallawa <wilfred.mallawa@wdc.com>

This fixes a bug where an uninitialized return value is used in
nvmet_sq_init().

Fixes: 206372d7c565 ("nvmet: support completion queue sharing")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505091619.QFU1fxsd-lkp@intel.com/
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
 drivers/nvme/target/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 042039011d7c..e30545586302 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1012,7 +1012,7 @@ int nvmet_sq_init(struct nvmet_sq *sq, struct nvmet_cq *cq)
 	int ret;
 
 	if (!nvmet_cq_get(cq))
-		return ret;
+		return -EINVAL;
 
 	ret = percpu_ref_init(&sq->ref, nvmet_sq_free, 0, GFP_KERNEL);
 	if (ret) {
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-12  6:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09 23:59 [PATCH] nvmet: nvmet_sq_init(): fix use of uninitialized variable Wilfred Mallawa
2025-05-10  0:10 ` Keith Busch
2025-05-12  5:24 ` Christoph Hellwig
2025-05-12  6:01   ` Wilfred Mallawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox