diff options
| author | Armin Wolf <W_Armin@gmx.de> | 2025-10-08 01:41:46 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-10-24 10:29:29 +0200 |
| commit | d91a1d129b63614fa4c2e45e60918409ce36db7e (patch) | |
| tree | fff38acadd4ab9f80a91f90c3e602d2c1ae6e6ff /drivers/acpi/fan_core.c | |
| parent | 58764259ebe0c9efd569194444629f6b26f86583 (diff) | |
ACPI: fan: Use platform device for devres-related actions
Device-managed resources are cleaned up when the driver unbinds from
the underlying device. In our case this is the platform device as this
driver is a platform driver. Registering device-managed resources on
the associated ACPI device will thus result in a resource leak when
this driver unbinds.
Ensure that any device-managed resources are only registered on the
platform device to ensure that they are cleaned up during removal.
Fixes: 35c50d853adc ("ACPI: fan: Add hwmon support")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Cc: 6.11+ <stable@vger.kernel.org> # 6.11+
Link: https://patch.msgid.link/20251007234149.2769-4-W_Armin@gmx.de
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/fan_core.c')
| -rw-r--r-- | drivers/acpi/fan_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c index ea2c646c470c..46e7fe7a506d 100644 --- a/drivers/acpi/fan_core.c +++ b/drivers/acpi/fan_core.c @@ -347,7 +347,7 @@ static int acpi_fan_probe(struct platform_device *pdev) } if (fan->has_fst) { - result = devm_acpi_fan_create_hwmon(device); + result = devm_acpi_fan_create_hwmon(&pdev->dev); if (result) return result; |
