thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe
authorZheng Yongjun <zhengyongjun3@huawei.com>
Mon, 25 Apr 2022 09:29:29 +0000 (09:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:01 +0000 (10:23 +0200)
commitef1235c6514a58f274246cf4a2d5f4e40af539ce
tree0f5ed15495f5f002195dccd84137a759a19e9da5
parentc4e1280abead1552e1764684079a43e222ccd163
thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe

[ Upstream commit e20d136ec7d6f309989c447638365840d3424c8e ]

platform_get_resource() may return NULL, add proper check to
avoid potential NULL dereferencing.

Fixes: 250e211057c72 ("thermal: broadcom: Add Stingray thermal driver")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20220425092929.90412-1-zhengyongjun3@huawei.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/broadcom/sr-thermal.c