lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 10 Mar 2023 08:42:56 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     void0red <void0red@...il.com>
Cc:     jdelvare@...e.com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org, mezin.alexander@...il.com
Subject: Re: [PATCH v2 1/2] hwmon: g762: add a check of devm_add_action in
 g762_of_clock_enable

On Mon, Feb 27, 2023 at 11:09:12AM +0800, void0red wrote:
> From: Kang Chen <void0red@...il.com>
> 
> devm_add_action may fails, check it and do the cleanup.
> 
> Signed-off-by: Kang Chen <void0red@...il.com>

Applied.

Thanks,
Guenter

> ---
> v2 -> v1: split the patch
> 
>  drivers/hwmon/g762.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/g762.c b/drivers/hwmon/g762.c
> index 64a0599b2..e2c3c34f0 100644
> --- a/drivers/hwmon/g762.c
> +++ b/drivers/hwmon/g762.c
> @@ -620,7 +620,12 @@ static int g762_of_clock_enable(struct i2c_client *client)
>  	data = i2c_get_clientdata(client);
>  	data->clk = clk;
>  
> -	devm_add_action(&client->dev, g762_of_clock_disable, data);
> +	ret = devm_add_action(&client->dev, g762_of_clock_disable, data);
> +	if (ret) {
> +		dev_err(&client->dev, "failed to add disable clock action\n");
> +		goto clk_unprep;
> +	}
> +
>  	return 0;
>  
>   clk_unprep:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ