diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-07-29 17:39:07 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-03 19:14:26 +0200 |
commit | d5a8aa5d7d80d21ab6b266f1bed4194b61746199 (patch) | |
tree | e719df9b5e7808c00858063f606cadc19360fec4 /drivers/thermal/Kconfig | |
parent | c1dbe9a1c86da098a29dcdca1a67b65e2de7ec3a (diff) | |
download | lwn-d5a8aa5d7d80d21ab6b266f1bed4194b61746199.tar.gz lwn-d5a8aa5d7d80d21ab6b266f1bed4194b61746199.zip |
thermal: sysfs: Fix cooling_device_stats_setup() error code path
If cooling_device_stats_setup() fails to create the stats object, it
must clear the last slot in cooling_device_attr_groups that was
initially empty (so as to make it possible to add stats attributes to
the cooling device attribute groups).
Failing to do so may cause the stats attributes to be created by
mistake for a device that doesn't have a stats object, because the
slot in question might be populated previously during the registration
of another cooling device.
Fixes: 8ea229511e06 ("thermal: Add cooling device's statistics in sysfs")
Reported-by: Di Shen <di.shen@unisoc.com>
Tested-by: Di Shen <di.shen@unisoc.com>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/Kconfig')
0 files changed, 0 insertions, 0 deletions