mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
hwmon: (g762) add a check of devm_add_action in g762_of_clock_enable
devm_add_action may fails, check it and do the cleanup. Signed-off-by: Kang Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user