]> git.baikalelectronics.ru Git - kernel.git/commit
thermal/core: Fix null pointer dereference in thermal_release()
authorYuanzheng Song <songyuanzheng@huawei.com>
Fri, 15 Oct 2021 08:32:30 +0000 (08:32 +0000)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 15 Oct 2021 11:58:36 +0000 (13:58 +0200)
commit1c116aea2dbd2188849ee5e203f9b064a3b1ae66
treeefc4dbae3cb78bec79e18635c03a6515a95ab9d1
parentd8f25568c864b6849317e603b13d80b3fdaf1785
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.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/thermal_core.c