mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
hwmon: (w83793) remove vrm sysfs file on probe failure
commit 77b9837572 upstream.
w83793_probe() creates the vrm sysfs file after creating the VID files
when VID support is present.
The normal remove path deletes vrm, but the probe error path only
removes the sensor, SDA, VID, fan, PWM and temperature files. A later
probe failure can therefore leave vrm behind after the driver data has
been freed.
Remove vrm in the probe error path next to the VID files, matching the
normal remove path.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20260615064806.51139-1-pengpeng@iscas.ac.cn
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
43d49fa630
commit
22f864f747
@@ -1918,6 +1918,7 @@ exit_remove:
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(w83793_vid); i++)
|
||||
device_remove_file(dev, &w83793_vid[i].dev_attr);
|
||||
device_remove_file(dev, &dev_attr_vrm);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++)
|
||||
device_remove_file(dev, &w83793_left_fan[i].dev_attr);
|
||||
|
||||
Reference in New Issue
Block a user