Commit b9bb92e1 authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (gpio-fan) Check return value from devm_add_action_or_reset

devm_add_action_or_reset() can fail due to a memory allocation failure.
Check for it and return the error if that happens.

Fixes: 95347845 ("hwmon: (gpio-fan) Use devm_thermal_of_cooling_device_register")
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 4b972a01
...@@ -524,7 +524,9 @@ static int gpio_fan_probe(struct platform_device *pdev) ...@@ -524,7 +524,9 @@ static int gpio_fan_probe(struct platform_device *pdev)
err = fan_ctrl_init(fan_data); err = fan_ctrl_init(fan_data);
if (err) if (err)
return err; return err;
devm_add_action_or_reset(dev, gpio_fan_stop, fan_data); err = devm_add_action_or_reset(dev, gpio_fan_stop, fan_data);
if (err)
return err;
} }
/* Make this driver part of hwmon class. */ /* Make this driver part of hwmon class. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment