All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] hwmon: (ads1015) Fix file leak in probe function
@ 2012-02-22 16:19 Guenter Roeck
  2012-02-22 17:11 ` Jean Delvare
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2012-02-22 16:19 UTC (permalink / raw)
  To: lm-sensors

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 <guenter.roeck@ericsson.com>
Cc: Dirk Eibach <eibach@gdsys.de>
---
 drivers/hwmon/ads1015.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
index eedca3c..1a1f058 100644
--- 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_free;
+			goto exit_remove;
 	}
 
 	data->hwmon_dev = hwmon_device_register(&client->dev);
-- 
1.7.3.1


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] [PATCH] hwmon: (ads1015) Fix file leak in probe function
  2012-02-22 16:19 [lm-sensors] [PATCH] hwmon: (ads1015) Fix file leak in probe function Guenter Roeck
@ 2012-02-22 17:11 ` Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2012-02-22 17:11 UTC (permalink / raw)
  To: lm-sensors

On Wed, 22 Feb 2012 08:19:31 -0800, Guenter Roeck wrote:
> 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 <guenter.roeck@ericsson.com>
> Cc: Dirk Eibach <eibach@gdsys.de>
> ---
>  drivers/hwmon/ads1015.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
> index eedca3c..1a1f058 100644
> --- 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_free;
> +			goto exit_remove;
>  	}
>  
>  	data->hwmon_dev = hwmon_device_register(&client->dev);

Good catch.

Acked-by: Jean Delvare <khali@linux-fr.org>

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-22 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22 16:19 [lm-sensors] [PATCH] hwmon: (ads1015) Fix file leak in probe function Guenter Roeck
2012-02-22 17:11 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.