From: Ben Cheatham <benjamin.cheatham@amd.com>
To: Dan Williams <dan.j.williams@intel.com>, rafael.j.wysocki@intel.com
Cc: stable@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-acpi@vger.kernel.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH] ACPI: APEI: EINJ: Fix einj_dev release leak
Date: Wed, 22 May 2024 08:40:10 -0500 [thread overview]
Message-ID: <0da7f58a-309f-4e25-b2f8-3bd80902341c@amd.com> (raw)
In-Reply-To: <171633159194.398195.10059732788629089925.stgit@dwillia2-xfh.jf.intel.com>
On 5/21/24 5:46 PM, Dan Williams wrote:
> The platform driver conversion of EINJ mistakenly used
> platform_device_del() to unwind platform_device_register_full() at
> module exit. This leads to a small leak of one 'struct platform_device'
> instance per module load/unload cycle. Switch to
> platform_device_unregister() which performs both device_del() and final
> put_device().
>
Reviewed-by: Ben Cheatham <Benjamin.Cheatham@amd.com>
Thanks,
Ben
> Fixes: 5621fafaac00 ("EINJ: Migrate to a platform driver")
> Cc: <stable@vger.kernel.org>
> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Ben Cheatham <Benjamin.Cheatham@amd.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> drivers/acpi/apei/einj-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c
> index 01faca3a238a..bb9f8475ce59 100644
> --- a/drivers/acpi/apei/einj-core.c
> +++ b/drivers/acpi/apei/einj-core.c
> @@ -903,7 +903,7 @@ static void __exit einj_exit(void)
> if (einj_initialized)
> platform_driver_unregister(&einj_driver);
>
> - platform_device_del(einj_dev);
> + platform_device_unregister(einj_dev);
> }
>
> module_init(einj_init);
>
next prev parent reply other threads:[~2024-05-22 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 22:46 [PATCH] ACPI: APEI: EINJ: Fix einj_dev release leak Dan Williams
2024-05-22 13:40 ` Ben Cheatham [this message]
2024-05-27 10:36 ` Rafael J. Wysocki
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=0da7f58a-309f-4e25-b2f8-3bd80902341c@amd.com \
--to=benjamin.cheatham@amd.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=dan.j.williams@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.kernel.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