mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 17:42:03 +02:00
platform/x86/amd/hsmp: Clear mdev.this_device on deregister
misc_deregister() destroys the device but leaves miscdevice.this_device pointing at the freed struct device. Clear it so any later check of this_device, and a subsequent re-register, does not observe a stale pointer. An upcoming change uses this_device to track whether /dev/hsmp is registered across the shared ACPI sockets and relies on it being NULL after deregister. Signed-off-by: Muralidhara M K <muralidhara.mk@amd.com> Link: https://patch.msgid.link/20260723094656.3806028-5-muralidhara.mk@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
8da4fedd5d
commit
6bd243d5ab
|
|
@ -539,6 +539,7 @@ EXPORT_SYMBOL_NS_GPL(hsmp_misc_register, "AMD_HSMP");
|
|||
void hsmp_misc_deregister(void)
|
||||
{
|
||||
misc_deregister(&hsmp_pdev.mdev);
|
||||
hsmp_pdev.mdev.this_device = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(hsmp_misc_deregister, "AMD_HSMP");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user