]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thermal: thermal_of: Fix error return code of thermal_of_populate_bind_params()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Wed, 10 Mar 2021 12:24:23 +0000 (04:24 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:36 +0000 (10:29 +0200)
commitc55cd249c54538fd613a09d5c4241028ce58a657
treeb3c4cb2fa5ea3899889aa61630f7ade1d8237021
parent1ed3c7b213e931640f59dc65fb2b1cab1077bab9
thermal: thermal_of: Fix error return code of thermal_of_populate_bind_params()

[ Upstream commit 45c7eaeb29d67224db4ba935deb575586a1fda09 ]

When kcalloc() returns NULL to __tcbp or of_count_phandle_with_args()
returns zero or -ENOENT to count, no error return code of
thermal_of_populate_bind_params() is assigned.
To fix these bugs, ret is assigned with -ENOMEM and -ENOENT in these
cases, respectively.

Fixes: a92bab8919e3 ("of: thermal: Allow multiple devices to share cooling map")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210310122423.3266-1-baijiaju1990@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/thermal_of.c