]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ACPI: fan: cleanup resources in the error path of .probe()
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Wed, 11 Dec 2024 03:28:12 +0000 (12:28 +0900)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 16 Dec 2024 20:22:22 +0000 (21:22 +0100)
commitc759bc8e9046f9812238f506d70f07d3ea4206d4
tree0262f2e3aea8de2a225e8a5fdd4e2a4f112fd17b
parent78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
ACPI: fan: cleanup resources in the error path of .probe()

Call thermal_cooling_device_unregister() and sysfs_remove_link() in the
error path of acpi_fan_probe() to fix possible memory leak.

This bug was found by an experimental static analysis tool that I am
developing.

Fixes: 05a83d972293 ("ACPI: register ACPI Fan as generic thermal cooling device")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20241211032812.210164-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/fan_core.c