hwmon: (gpio-fan) Check return value from devm_add_action_or_reset
authorGuenter Roeck <linux@roeck-us.net>
Fri, 7 Jun 2019 20:19:12 +0000 (13:19 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 24 Jun 2019 01:32:34 +0000 (18:32 -0700)
commitb9bb92e1d1be921e91d8b469dc1261ea5ac71991
tree5e1dd447b0b10d10a7926065ea43216e640134e2
parent4b972a01a7da614b4796475f933094751a295a2f
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: 9534784550ab ("hwmon: (gpio-fan) Use devm_thermal_of_cooling_device_register")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/gpio-fan.c