Re: [PATCH v1] thermal: core: Address thermal zone removal races with resume
From: Rafael J. Wysocki
Date: Sat Mar 28 2026 - 07:52:22 EST
Hi,
On Sat, Mar 28, 2026 at 9:03 AM Dan Carpenter <error27@xxxxxxxxx> wrote:
>
> Hi Rafael,
>
> kernel test robot noticed the following build warnings:
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Rafael-J-Wysocki/thermal-core-Address-thermal-zone-removal-races-with-resume/20260327-222101
> base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
> patch link: https://lore.kernel.org/r/12876512.O9o76ZdvQC%40rafael.j.wysocki
> patch subject: [PATCH v1] thermal: core: Address thermal zone removal races with resume
> config: i386-randconfig-141-20260328 (https://download.01.org/0day-ci/archive/20260328/202603280307.P9324SuS-lkp@xxxxxxxxx/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> smatch: v0.5.0-9004-gb810ac53
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> | Closes: https://lore.kernel.org/r/202603280307.P9324SuS-lkp@xxxxxxxxx/
>
> smatch warnings:
> drivers/thermal/thermal_core.c:1913 thermal_init() warn: missing error code 'result'
>
> vim +/result +1913 drivers/thermal/thermal_core.c
>
> 203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 1900 static int __init thermal_init(void)
> 203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 1901 {
> 80a26a5c22b90a drivers/thermal/thermal_core.c Zhang Rui 2013-03-26 1902 int result;
> 80a26a5c22b90a drivers/thermal/thermal_core.c Zhang Rui 2013-03-26 1903
> 755113d7678681 drivers/thermal/thermal_core.c Daniel Lezcano 2024-01-09 1904 thermal_debug_init();
> 755113d7678681 drivers/thermal/thermal_core.c Daniel Lezcano 2024-01-09 1905
> d2a89b52839597 drivers/thermal/thermal_core.c Daniel Lezcano 2020-07-17 1906 result = thermal_netlink_init();
> d2a89b52839597 drivers/thermal/thermal_core.c Daniel Lezcano 2020-07-17 1907 if (result)
> d2a89b52839597 drivers/thermal/thermal_core.c Daniel Lezcano 2020-07-17 1908 goto error;
> d2a89b52839597 drivers/thermal/thermal_core.c Daniel Lezcano 2020-07-17 1909
> f777132b791874 drivers/thermal/thermal_core.c Rafael J. Wysocki 2026-03-26 1910 thermal_wq = alloc_workqueue("thermal_events",
> f777132b791874 drivers/thermal/thermal_core.c Rafael J. Wysocki 2026-03-26 1911 WQ_FREEZABLE | WQ_POWER_EFFICIENT | WQ_PERCPU, 0);
> f777132b791874 drivers/thermal/thermal_core.c Rafael J. Wysocki 2026-03-26 1912 if (!thermal_wq)
> f777132b791874 drivers/thermal/thermal_core.c Rafael J. Wysocki 2026-03-26 @1913 goto unregister_netlink;
>
> result = -ENOMEM;
>
>
> --
This has been fixed in the v2:
https://lore.kernel.org/linux-pm/6267615.lOV4Wx5bFT@rafael.j.wysocki/