Skip to content

Commit

Permalink
ACPI: APEI: EINJ: Fix einj_dev release leak
Browse files Browse the repository at this point in the history
commit 7ff6c79 upstream.

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: 5621faf ("EINJ: Migrate to a platform driver")
Cc: 6.9+ <stable@vger.kernel.org> # 6.9+
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Ben Cheatham <Benjamin.Cheatham@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
djbw authored and gregkh committed Jun 16, 2024
1 parent 797fd53 commit e6dc6a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/apei/einj-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e6dc6a2

Please sign in to comment.