Commit bc4d45f1901042a295b10949f51d24cce223e65d
Committed by
Jean Delvare
1 parent
5f441e2256
Exists in
master
and in
39 other branches
hwmon: (lm85) Fix error paths in probe function
We must remove all files we created, even in error cases. Fixes second part of kernel bug #34072: https://bugzilla.kernel.org/show_bug.cgi?id=34072 Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/hwmon/lm85.c
... | ... | @@ -1331,11 +1331,11 @@ |
1331 | 1331 | if (data->type != emc6d103s) { |
1332 | 1332 | err = sysfs_create_group(&client->dev.kobj, &lm85_group_minctl); |
1333 | 1333 | if (err) |
1334 | - goto err_kfree; | |
1334 | + goto err_remove_files; | |
1335 | 1335 | err = sysfs_create_group(&client->dev.kobj, |
1336 | 1336 | &lm85_group_temp_off); |
1337 | 1337 | if (err) |
1338 | - goto err_kfree; | |
1338 | + goto err_remove_files; | |
1339 | 1339 | } |
1340 | 1340 | |
1341 | 1341 | /* The ADT7463/68 have an optional VRM 10 mode where pin 21 is used |