public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: APEI: EINJ: Fix einj_dev release leak
@ 2024-05-21 22:46 Dan Williams
  2024-05-22 13:40 ` Ben Cheatham
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Williams @ 2024-05-21 22:46 UTC (permalink / raw)
  To: rafael.j.wysocki
  Cc: stable, Jonathan Cameron, Ben Cheatham, linux-acpi, linux-cxl

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().

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);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-27 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21 22:46 [PATCH] ACPI: APEI: EINJ: Fix einj_dev release leak Dan Williams
2024-05-22 13:40 ` Ben Cheatham
2024-05-27 10:36   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox