]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (w83793) remove vrm sysfs file on probe failure
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Mon, 15 Jun 2026 06:48:06 +0000 (14:48 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 29 Jun 2026 20:36:43 +0000 (13:36 -0700)
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>
drivers/hwmon/w83793.c

index b1f906f06ab43f67bba4041bd7b1229967154f20..a548586369e1db75809816e07218123f02a9fed2 100644 (file)
@@ -1917,6 +1917,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);