projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f2da1a
)
hwmon: (ads1015) Fix file leak in probe function
author
Guenter Roeck
<
[email protected]
>
Wed, 22 Feb 2012 16:13:52 +0000
(08:13 -0800)
committer
Guenter Roeck
<
[email protected]
>
Thu, 23 Feb 2012 14:47:41 +0000
(06:47 -0800)
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:
[email protected]
# 3.0+
Cc: Dirk Eibach <
[email protected]
>
Acked-by: Jean Delvare <
[email protected]
>
drivers/hwmon/ads1015.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/ads1015.c
b/drivers/hwmon/ads1015.c
index eedca3cf996889e5b9633c05656d58343f13a427..dd87ae96c2625cb8a93329fcfa672d5678f9e3a8 100644
(file)
--- a/
drivers/hwmon/ads1015.c
+++ b/
drivers/hwmon/ads1015.c
@@
-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_
fre
e;
+ goto exit_
remov
e;
}
data->hwmon_dev = hwmon_device_register(&client->dev);
@@
-285,7
+285,6
@@
static int ads1015_probe(struct i2c_client *client,
exit_remove:
for (k = 0; k < ADS1015_CHANNELS; ++k)
device_remove_file(&client->dev, &ads1015_in[k].dev_attr);
-exit_free:
kfree(data);
exit:
return err;