Skip to content

Commit

Permalink
hwmon: (lm85) Fix error paths in probe function
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Apr 29, 2011
1 parent 5f441e2 commit bc4d45f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/lm85.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,11 +1331,11 @@ static int lm85_probe(struct i2c_client *client,
if (data->type != emc6d103s) {
err = sysfs_create_group(&client->dev.kobj, &lm85_group_minctl);
if (err)
goto err_kfree;
goto err_remove_files;
err = sysfs_create_group(&client->dev.kobj,
&lm85_group_temp_off);
if (err)
goto err_kfree;
goto err_remove_files;
}

/* The ADT7463/68 have an optional VRM 10 mode where pin 21 is used
Expand Down

0 comments on commit bc4d45f

Please sign in to comment.