aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorJoe Hattori <[email protected]>2025-01-10 01:05:54 +0000
committerRafael J. Wysocki <[email protected]>2025-01-23 20:28:18 +0000
commit93c66fbc280747ea700bd6199633d661e3c819b3 (patch)
treebd41a339b3bf551e6635ece27e19fefb5c250a47 /rust/helpers/helpers.c
parentMerge tag 'pm-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafa... (diff)
downloadkernel-93c66fbc280747ea700bd6199633d661e3c819b3.tar.gz
kernel-93c66fbc280747ea700bd6199633d661e3c819b3.zip
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 <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions