[PATCH] i2c: i801: fix usage_count leak when autosuspend_delay is negative
Guangshuo Li <[email protected]> Wed, 12 Aug 2026 16:47:49 +0800
| Newsgroups | org.kernel.vger.linux-i2c,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
i801_probe() calls pm_runtime_use_autosuspend(), but i801_remove()
does not call the matching pm_runtime_dont_use_autosuspend() when
tearing down the device.
If the autosuspend delay is set to a negative value while autosuspend
is enabled, the runtime PM core increments usage_count to prevent
runtime suspend. Without calling pm_runtime_dont_use_autosuspend()
during driver teardown, this reference is not dropped and usage_count
remains unbalanced.
Add the missing pm_runtime_dont_use_autosuspend() call in i801_remove()
before restoring the runtime PM usage reference.
This issue was found by manual code inspection.
Fixes: a7401ca5596e ("i2c: i801: Add runtime PM support with autosuspend")
Signed-off-by: Guangshuo Li <[email protected]>
---
drivers/i2c/busses/i2c-i801.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index b29c99ed3883..629115b5c76d 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1698,6 +1698,8 @@ static void i801_remove(struct pci_dev *dev)
platform_device_unregister(priv->tco_pdev);
+ pm_runtime_dont_use_autosuspend(&dev->dev);
+
/* if acpi_reserved is set then usage_count is incremented already */
if (!priv->acpi_reserved)
pm_runtime_get_noresume(&dev->dev);
--
2.43.0