hwmon: (ads1015) Fix file leak in probe function
PATCH 1/1 hwmon: (ads1015) Fix file leak in probe function
An error while creating sysfs attribute files in the driver's probe function results in an error abort, but already created files are not removed. This patch fixes the problem.
Signed-off-by Guenter Roeck <[email protected]>
Cc Dirk Eibach <[email protected]>
--- drivers/hwmon/ads1015.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/ads1015.c +1 -1
@@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client,continue ; err =device_create_file (&client->dev, &ads1015_in[k].dev_attr);if (err) - goto exit_free; + goto exit_remove; } data->hwmon_dev =hwmon_device_register (&client->dev);
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 15 lines · Guenter Roeck
An error while creating sysfs attribute files in the driver's probe function results in an error abort, but already created files are not removed. This patch fixes the problem.
Signed-off-by Guenter Roeck <[email protected]>Cc Dirk Eibach <[email protected]>--- drivers/hwmon/ads1015.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/hwmon/ads1015.c +0
-0
drivers/hwmon/ads1015.c static int ads1015_probe(struct i2c_client *client, · line 277
Quoted 8 lines
drivers/hwmon/ads1015.c +1
-1@@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client,continue ; err =device_create_file (&client->dev, &ads1015_in[k].dev_attr);if (err) - goto exit_free; + goto exit_remove; } data->hwmon_dev =hwmon_device_register (&client->dev);
Good catch.
Acked-by Jean Delvare <[email protected]>
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors