From: Keith Busch <kbusch@kernel.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Maurizio Lombardi <mlombard@redhat.com>,
Yi Zhang <yi.zhang@redhat.com>,
"open list:NVM EXPRESS DRIVER" <linux-nvme@lists.infradead.org>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Hannes Reinecke <hare@suse.de>
Subject: Re: blktests nvme 041,042 leak memory
Date: Wed, 29 May 2024 10:48:42 -0600 [thread overview]
Message-ID: <Zldcag69LsVZWTNk@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <ZldW7nNrqHCTYTEF@kbusch-mbp.dhcp.thefacebook.com>
On Wed, May 29, 2024 at 10:25:18AM -0600, Keith Busch wrote:
> ---
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index f5d150c62955d..72c9693e1df61 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4601,7 +4601,8 @@ static void nvme_free_ctrl(struct device *dev)
> mutex_unlock(&nvme_subsystems_lock);
> }
>
> - ctrl->ops->free_ctrl(ctrl);
> + if (nvme_ctrl_state(ctrl) != NVME_CTRL_NEW)
> + ctrl->ops->free_ctrl(ctrl);
I think this may be problematic. If nvme_init_ctrl() is successful,
there are other things that might fail before CONNECTING state has been
reached, and those failures need their free_ctrl callback invoked from
the "NEW" state.
next prev parent reply other threads:[~2024-05-29 16:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-26 19:47 blktests nvme 041,042 leak memory Sagi Grimberg
2024-05-27 1:11 ` Yi Zhang
2024-05-28 9:44 ` Maurizio Lombardi
2024-05-29 9:08 ` Maurizio Lombardi
2024-05-29 12:51 ` Sagi Grimberg
2024-05-29 13:45 ` Maurizio Lombardi
2024-05-29 16:25 ` Keith Busch
2024-05-29 16:48 ` Keith Busch [this message]
2024-05-30 6:59 ` Sagi Grimberg
2024-05-30 7:25 ` Maurizio Lombardi
2024-05-30 16:29 ` Keith Busch
2024-05-30 17:40 ` Maurizio Lombardi
2024-05-31 11:55 ` Maurizio Lombardi
2024-05-31 14:37 ` Maurizio Lombardi
2024-06-03 8:37 ` Hannes Reinecke
2024-06-03 8:52 ` Maurizio Lombardi
2024-06-03 9:33 ` Hannes Reinecke
2024-06-03 9:38 ` Maurizio Lombardi
2024-06-03 9:35 ` Maurizio Lombardi
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=Zldcag69LsVZWTNk@kbusch-mbp.dhcp.thefacebook.com \
--to=kbusch@kernel.org \
--cc=hare@suse.de \
--cc=linux-nvme@lists.infradead.org \
--cc=mlombard@redhat.com \
--cc=sagi@grimberg.me \
--cc=shinichiro.kawasaki@wdc.com \
--cc=yi.zhang@redhat.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