mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10.git
synced 2026-09-09 00:07:04 +08:00
usb: chipidea: fix usage_count leak when autosuspend_delay is negative
JIRA: https://redhat.atlassian.net/browse/RHEL-248519
commit fc3afb5728e297994863f8a2a01b88a920bbf53e
Author: Xu Yang <xu.yang_2@nxp.com>
Date: Thu Jul 16 18:41:26 2026 +0800
usb: chipidea: fix usage_count leak when autosuspend_delay is negative
The probe() calls pm_runtime_use_autosuspend(), but remove() does not call
pm_runtime_dont_use_autosuspend(). This can lead to a usage_count leak if
autosuspend_delay is set to a negative value.
The pm_runtime_use_autosuspend() also notes that it's important to undo
this with pm_runtime_dont_use_autosuspend() at driver exit time.
Fixes: 1f874edcb7 ("usb: chipidea: add runtime power management support")
Cc: stable <stable@kernel.org>
Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260716104126.2763454-1-xu.yang_2@oss.nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jared Kangas <jkangas@redhat.com>
This commit is contained in:
@@ -1250,6 +1250,7 @@ static void ci_hdrc_remove(struct platform_device *pdev)
|
||||
usb_role_switch_unregister(ci->role_switch);
|
||||
|
||||
if (ci->supports_runtime_pm) {
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
|
||||
Reference in New Issue
Block a user