Skip to content
Commit ed08f958 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

thermal/core: fix error code in __thermal_cooling_device_register()

[ Upstream commit e49a1e1e ]

Return an error pointer if ->get_max_state() fails.  The current code
returns NULL which will cause an oops in the callers.

Fixes: c408b3d1

 ("thermal: Validate new state in cur_state_store()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 6c54b7bc

 ("thermal: core: call put_device() only after device_register() fails")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 108a6f91
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