thermal/core: Fix null pointer dereference in thermal_release()
If both dev_set_name() and device_register() failed, then null pointer dereference occurs in thermal_release() which will use strncmp() to compare the name. So fix it by adding dev_set_name() return value check. Signed-off-by: Yuanzheng Song <songyuanzheng@huawei.com> Link: https://lore.kernel.org/r/20211015083230.67658-1-songyuanzheng@huawei.comSigned-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Showing
Please register or sign in to comment