From: Dan Carpenter <dan.carpenter@oracle.com>
To: Keith Busch <kbusch@kernel.org>, Kanchan Joshi <joshi.k@samsung.com>
Cc: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>,
Anuj Gupta <anuj20.g@samsung.com>,
linux-nvme@lists.infradead.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] nvme: uninitialized return in nvme_ns_head_chr_uring_cmd()
Date: Mon, 9 May 2022 12:06:42 +0300 [thread overview]
Message-ID: <YnjZovrfnF0YYuvN@kili> (raw)
The "ret" value is not set if "ns" is zero.
Fixes: 86116c2f6fee ("nvme: wire-up uring-cmd support for io-passthru on char-device.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/nvme/host/ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index 4b91e452768b..c118559d47f0 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -688,7 +688,7 @@ int nvme_ns_head_chr_uring_cmd(struct io_uring_cmd *ioucmd,
struct nvme_ns_head *head = container_of(cdev, struct nvme_ns_head, cdev);
int srcu_idx = srcu_read_lock(&head->srcu);
struct nvme_ns *ns = nvme_find_path(head);
- int ret;
+ int ret = 0;
if (ns)
ret = nvme_ns_uring_cmd(ns, ioucmd, issue_flags);
--
2.35.1
next reply other threads:[~2022-05-09 9:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220509090735epcas5p372dacbf5a9615ebb97ac8156694866c2@epcas5p3.samsung.com>
2022-05-09 9:06 ` Dan Carpenter [this message]
2022-05-09 17:37 ` [PATCH] nvme: uninitialized return in nvme_ns_head_chr_uring_cmd() Kanchan Joshi
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=YnjZovrfnF0YYuvN@kili \
--to=dan.carpenter@oracle.com \
--cc=anuj20.g@samsung.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.