diff options
author | Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> | 2025-01-10 04:05:54 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-01-23 23:28:18 +0300 |
commit | 93c66fbc280747ea700bd6199633d661e3c819b3 (patch) | |
tree | bd41a339b3bf551e6635ece27e19fefb5c250a47 /scripts/extract-fwblobs | |
parent | f4b9d3bf44d59ca4489bd8c489539c27c02e5c6a (diff) | |
download | linux-93c66fbc280747ea700bd6199633d661e3c819b3.tar.xz |
powercap: call put_device() on an error path in powercap_register_control_type()
powercap_register_control_type() calls device_register(), but does not
release the refcount of the device when it fails.
Call put_device() before returning an error to balance the refcount.
Since the kfree(control_type) will be done by powercap_release(), remove
the lines in powercap_register_control_type() before returning the error.
This bug was found by an experimental verifier that I am developing.
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20250110010554.1583411-1-joe@pf.is.s.u-tokyo.ac.jp
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts/extract-fwblobs')
0 files changed, 0 insertions, 0 deletions