From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4373323EAB3; Fri, 4 Sep 2026 06:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788502492; cv=none; b=pFoBGrdyNWH96QNHBoXzO5zt/I6ET4fZTOzwbVkjGEPB0Clt+KpnZOuWWo92rnujuYRCdWF48TXAf8QW1fG8gpxIfOPUY9K6tHMkV1dOzoyJXR0SpiMO7xBU4j6RqTkQ4vdCdr5lwhtQ1p4jB+wE+lMXjYt0k2zT4HmZU7jVo6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788502492; c=relaxed/simple; bh=4VLuZCBnnscWZF5lcokVcbxb5tpuBOzqAJdskNlUHMU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y4asbB1wGS9Da2eDzr+z73pOMfhNLp23bGB2zDk1xi+3NCAT7/otQYN/eN0NZ1Bty4CtCs3qJGvySKOj8wRevcfxi+8YklFsOwdH06tQ5r7gh3Xc5d6tXyqiVvXX/fWkRjRqpebPF/Ljw2JISZubdlf1NufSHHKVXmihR7L+gFQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cMKyyjuC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cMKyyjuC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A3811F00A3D; Fri, 4 Sep 2026 06:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788502491; bh=wiP8kSoV5j2RqvjbIOWZcF4BR9A08hZKL0udp/bRyiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cMKyyjuCOn2YS2ZY9GpU7qswh9in/qTUQpGgT1MHzDGvAHB4lU4S7PtpvbsNz1gcY b10J72rTyd49G34jPE/vS+P7vD+a7nOpdepi9VQaTcoQ2ykonpPEr1cynZ29wCun4w ++aZvCMjV7hAnde/e5r8mlsR8GE1pEuQtSjjr28c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Luiz Augusto von Dentz Subject: [PATCH 6.12 183/403] Bluetooth: hci_h5: fix usage_count leak when autosuspend_delay is negative Date: Fri, 4 Sep 2026 06:59:46 +0200 Message-ID: <20260904045739.018378295@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045734.806166532@linuxfoundation.org> References: <20260904045734.806166532@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li commit 853a92b97ca547a7ddd9790ff90651b2fd943498 upstream. h5_btrtl_open() calls pm_runtime_use_autosuspend(), but h5_btrtl_close() does not call the matching pm_runtime_dont_use_autosuspend() when tearing down runtime PM. 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 before disabling runtime PM. This issue was found by manual code inspection. Fixes: d9dd833cf6d2 ("Bluetooth: hci_h5: Add runtime suspend") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/hci_h5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -987,8 +987,10 @@ static void h5_btrtl_open(struct h5 *h5) static void h5_btrtl_close(struct h5 *h5) { - if (!test_bit(H5_WAKEUP_DISABLE, &h5->flags)) + if (!test_bit(H5_WAKEUP_DISABLE, &h5->flags)) { + pm_runtime_dont_use_autosuspend(&h5->hu->serdev->dev); pm_runtime_disable(&h5->hu->serdev->dev); + } gpiod_set_value_cansleep(h5->device_wake_gpio, 0); gpiod_set_value_cansleep(h5->enable_gpio, 0);