]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thermal/drivers/devfreq_cooling: Fix wrong return on error path
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 19 Mar 2021 19:41:45 +0000 (20:41 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 19 Mar 2021 20:20:47 +0000 (21:20 +0100)
commit0ab06a236365f50e59c5031d4709f02b002448ba
treec7878d5c646710d8f9be06b580eb9a809f175695
parent35b649a3cc1c45f9459ae6ee8e669c694dc62e0e
thermal/drivers/devfreq_cooling: Fix wrong return on error path

The following error is reported by kbuild:

 smatch warnings:
 drivers/thermal/devfreq_cooling.c:433 of_devfreq_cooling_register_power() warn: passing zero to 'ERR_PTR'

Fix the error code by the setting the 'err' variable instead of 'cdev'.

Fixes: f8d354e821b2 ("thermal/drivers/devfreq_cooling: Use device name instead of auto-numbering")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/devfreq_cooling.c