diff options
| author | Sumeet Pawnikar <sumeet4linux@gmail.com> | 2026-08-22 15:16:57 +0530 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-08-24 12:29:58 +0200 |
| commit | 916b61abba586d950a4d8264e2841cc5ccfa4df1 (patch) | |
| tree | 457e51463c38dd84fee4fd6dfcc85f5c8aa473ec /samples/workqueue | |
| parent | a8b842366f8ff469fe0fc700ba53770ded847ea9 (diff) | |
| download | linux-stable-916b61abba586d950a4d8264e2841cc5ccfa4df1.tar.gz linux-stable-916b61abba586d950a4d8264e2841cc5ccfa4df1.zip | |
powercap: intel_rapl: Fix kernel panic during PMU unbind
rapl_package_add_pmu() fails internally at perf_pmu_register(),
and rapl_pmu_update() leaves the global rapl_pmu.pmu structure
zero-initialized via memset and returns an error. But any
previously probed packages retain has_pmu = true.
When the driver is subsequently unbound or removed,
rapl_package_remove_pmu_locked() sees has_pmu == true and
unconditionally calls perf_pmu_unregister(&rapl_pmu.pmu) on the
zeroed-out structure. This attempts a list_del_rcu() on a NULL
list head, immediately causing a kernel panic.
Fix this by checking if the PMU is actually registered before
attempting to unregister it.
Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ rjw: Added empty line after the new conditional ]
Link: https://patch.msgid.link/20260822094657.12489-1-sumeet4linux@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'samples/workqueue')
0 files changed, 0 insertions, 0 deletions
