From: Daniel Wagner <dwagner@suse.de>
To: Hannes Reinecke <hare@suse.de>
Cc: Enzo Matsumiya <ematsumiya@suse.de>,
Sagi Grimberg <sagi@grimberg.me>,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
Jens Axboe <axboe@fb.com>, Keith Busch <kbusch@kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] nvme: hwmon: fix crash on device teardown
Date: Mon, 11 Jan 2021 17:18:57 +0100 [thread overview]
Message-ID: <20210111161857.okecoo4h4b4prpic@beryllium.lan> (raw)
In-Reply-To: <412d45ef-40af-24c3-4aa2-042ecbba05cd@suse.de>
On Mon, Jan 11, 2021 at 05:00:18PM +0100, Hannes Reinecke wrote:
> Yeah, using the controller node for devm allocations is quite dodgy.
> Does this one help?
>
> diff --git a/drivers/nvme/host/hwmon.c b/drivers/nvme/host/hwmon.c
> index 6fdd07fb3001..7260af028cf7 100644
> --- a/drivers/nvme/host/hwmon.c
> +++ b/drivers/nvme/host/hwmon.c
> @@ -226,7 +226,7 @@ static const struct hwmon_chip_info
>
> int nvme_hwmon_init(struct nvme_ctrl *ctrl)
> {
> - struct device *dev = ctrl->dev;
> + struct device *dev = ctrl->device;
This is what I tried. Yes, it fixes the obvious problem and moves the
hwmon entry under the nvme entry. When the nvme is destroyed, the hwmon
entry is not accessible. But as ctrl->device is not managed by devm the
resources are not freed.
prev parent reply other threads:[~2021-01-11 16:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 21:32 Enzo Matsumiya
2020-12-10 4:35 ` Chaitanya Kulkarni
2020-12-30 13:23 ` Daniel Wagner
2020-12-10 15:05 ` Keith Busch
2020-12-11 14:12 ` Hannes Reinecke
2020-12-30 14:38 ` Daniel Wagner
2020-12-30 15:16 ` Daniel Wagner
2020-12-30 15:31 ` Daniel Wagner
2021-01-04 21:06 ` Enzo Matsumiya
2021-01-05 9:45 ` Daniel Wagner
2021-01-11 16:00 ` Hannes Reinecke
2021-01-11 16:06 ` Christoph Hellwig
2021-01-11 16:18 ` Daniel Wagner [this message]
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=20210111161857.okecoo4h4b4prpic@beryllium.lan \
--to=dwagner@suse.de \
--cc=axboe@fb.com \
--cc=ematsumiya@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®