* [PATCH] usb: xhci: Fix runtime PM usage count leak in port bandwidth debugfs
@ 2026-11-29 7:26 Arina Kharlamova via B4 Relay
2026-11-29 7:29 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-11-29 7:26 UTC (permalink / raw)
To: Mathias Nyman, Greg Kroah-Hartman, Xu Rao
Cc: Mathias Nyman, linux-usb, Arina Kharlamova
From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
xhci_port_bw_show() returns when pm_runtime_get_sync() fails without
dropping the usage count that pm_runtime_get_sync() always takes, so
each failed read of the debugfs file leaks one count.
Use pm_runtime_resume_and_get(), which drops the count on failure.
Fixes: 59d50e53e070 ("usb: xhci: Add debugfs support for xHCI port bandwidth")
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
Found by checks derived from the spec2patch kernel API specifications,
with the help of an AI coding assistant (Claude); I reviewed the
analysis and the fix.
---
drivers/usb/host/xhci-debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c
index 2aa01d99f23d..1fe8387882f6 100644
--- a/drivers/usb/host/xhci-debugfs.c
+++ b/drivers/usb/host/xhci-debugfs.c
@@ -679,7 +679,7 @@ static int xhci_port_bw_show(struct xhci_hcd *xhci, u8 dev_speed,
struct usb_hcd *hcd = xhci_to_hcd(xhci);
struct device *dev = hcd->self.controller;
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0)
return ret;
---
base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
change-id: 20261129-s2p-c11-e972a338e8cb
Best regards,
--
Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-29 7:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 7:26 [PATCH] usb: xhci: Fix runtime PM usage count leak in port bandwidth debugfs Arina Kharlamova via B4 Relay
2026-11-29 7:29 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox