Re: [PATCH] hwmon: (ads1015) Fix file leak in probe function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
> Cc: Dirk Eibach <eibach@xxxxxxxx>
> ---
>  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@xxxxxxxxxxxx>

-- 
Jean Delvare

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


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux