]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thermal/drivers/cpuidle_cooling: Fix use after error
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 19 Mar 2021 20:13:16 +0000 (21:13 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 19 Mar 2021 20:21:20 +0000 (21:21 +0100)
commit17a05d1d2a9d2d2678c5c7e6980296f25d66ebd8
tree4bbf662d300f5e73549426095013affc538bdf78
parent0ab06a236365f50e59c5031d4709f02b002448ba
thermal/drivers/cpuidle_cooling: Fix use after error

When the function successfully finishes it logs an information about
the registration of the cooling device and use its name to build the
message. Unfortunately it was freed right before:

drivers/thermal/cpuidle_cooling.c:218 __cpuidle_cooling_register()
warn: 'name' was already freed.

Fix this by freeing after the message happened.

Fixes: 6fd1b186d900 ("thermal/drivers/cpuidle_cooling: Use device name instead of auto-numbering")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/cpuidle_cooling.c