public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: chaitanyak@nvidia.com
Cc: alan.adamson@oracle.com, linux-nvme@lists.infradead.org,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH] nvme: fix error handling in nvme_init_ctrl()
Date: Tue, 28 Mar 2023 02:44:06 +0900	[thread overview]
Message-ID: <20230327174406.10880-1-akinobu.mita@gmail.com> (raw)
In-Reply-To: <8ce877b6-5b25-e71e-9061-dcda19c2bf9b@nvidia.com>

This fixes error handling when nvme_auth_init_ctrl() returns an error in
nvme_init_ctrl().

This problem is reproducible by blktests nvme/044.
The nvme fault-injection debugfs directory was not removed after running
the test.

Reported-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/linux-nvme/40baa75e-fdf5-cb73-5fa8-b12d65bce4e7@nvidia.com
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 4eb62a7dac44..0545b3ea5a44 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -5197,6 +5197,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
 
 	return 0;
 out_free_cdev:
+	nvme_fault_inject_fini(&ctrl->fault_inject);
 	cdev_device_del(&ctrl->cdev, ctrl->device);
 out_free_name:
 	nvme_put_ctrl(ctrl);
-- 
2.34.1



  reply	other threads:[~2023-03-27 17:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  8:18 debugfs message during creation of the NVMeOf controller Chaitanya Kulkarni
2023-03-24 22:34 ` alan.adamson
2023-03-26 23:44   ` Chaitanya Kulkarni
2023-03-26 23:48     ` Chaitanya Kulkarni
2023-03-27  5:27       ` Chaitanya Kulkarni
2023-03-27 17:44         ` Akinobu Mita [this message]
2023-03-27 18:23           ` [PATCH] nvme: fix error handling in nvme_init_ctrl() Chaitanya Kulkarni
2023-03-27 22:12           ` alan.adamson
2023-04-25  8:31         ` debugfs message during creation of the NVMeOf controller Yi Zhang

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=20230327174406.10880-1-akinobu.mita@gmail.com \
    --to=akinobu.mita@gmail.com \
    --cc=alan.adamson@oracle.com \
    --cc=chaitanyak@nvidia.com \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    /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