diff options
| author | Muralidhara M K <muralidhara.mk@amd.com> | 2026-07-23 15:16:54 +0530 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2026-07-24 19:12:16 +0300 |
| commit | 6bd243d5abd91ee7d7fa58a9ed60381da49b4b0a (patch) | |
| tree | ea72f81e681879d2b5103aa5b3f35f74c742af6e | |
| parent | 8da4fedd5d1147d26e6ddbd7be2f1f5519df37dd (diff) | |
| download | linux-next-6bd243d5abd91ee7d7fa58a9ed60381da49b4b0a.tar.gz linux-next-6bd243d5abd91ee7d7fa58a9ed60381da49b4b0a.zip | |
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>
| -rw-r--r-- | drivers/platform/x86/amd/hsmp/hsmp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/x86/amd/hsmp/hsmp.c b/drivers/platform/x86/amd/hsmp/hsmp.c index fd36c8f142c0..584fd9b1d31f 100644 --- a/drivers/platform/x86/amd/hsmp/hsmp.c +++ b/drivers/platform/x86/amd/hsmp/hsmp.c @@ -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"); |
