From: John Garry <john.garry@huawei.com>
To: Zenghui Yu <yuzenghui@huawei.com>, <linux-scsi@vger.kernel.org>,
<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <fujita.tomonori@lab.ntt.co.jp>, <axboe@kernel.dk>,
<martin.petersen@oracle.com>, <hch@lst.de>,
<gregkh@linuxfoundation.org>, <johan@kernel.org>,
<wanghaibin.wang@huawei.com>
Subject: Re: [PATCH v2] scsi: bsg: Fix device unregistration
Date: Tue, 14 Sep 2021 10:53:04 +0100 [thread overview]
Message-ID: <b4ade32d-30b0-5b8d-5384-971b78fcfc6c@huawei.com> (raw)
In-Reply-To: <20210911105306.1511-1-yuzenghui@huawei.com>
On 11/09/2021 11:53, Zenghui Yu wrote:
> We use device_initialize() to take refcount for the device but forget to
> put_device() on device teardown, which ends up leaking private data of the
> driver core, dev_name(), etc. This is reported by kmemleak at boot time if
> we compile kernel with DEBUG_TEST_DRIVER_REMOVE.
>
> Note that adding the missing put_device() is_not_ sufficient to fix device
> unregistration. As we don't provide the .release() method for device, which
> turned out to be typically wrong and will be complained loudly by the
> driver core.
>
> Fix both of them.
>
> Fixes: ead09dd3aed5 ("scsi: bsg: Simplify device registration")
> Signed-off-by: Zenghui Yu<yuzenghui@huawei.com>
FWIW,
Tested-by: John Garry <john.garry@huawei.com>
prev parent reply other threads:[~2021-09-14 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-11 10:53 Zenghui Yu
2021-09-13 7:39 ` Johan Hovold
2021-09-14 4:40 ` Martin K. Petersen
2021-09-14 9:53 ` John Garry [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=b4ade32d-30b0-5b8d-5384-971b78fcfc6c@huawei.com \
--to=john.garry@huawei.com \
--cc=axboe@kernel.dk \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=johan@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=wanghaibin.wang@huawei.com \
--cc=yuzenghui@huawei.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
all inboxes | Powered by JetHome®