From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381796; b=Fqeq+C/CLn37qpJ2s4z8zsyAItDZLKS01RWZN5thuTUesd4aaaVhdqGGyQUCFuylrmyi mIddXoQLonT7RYCRa2zYdA3UqbITt+CMAtna/1ATxAKf/ihCdK3/qBqolIxNr0iHXsHLl rR04k4yuVq8KF6Jjj1dj/8IDygO+xbwZI3TfO8Cpf69LNUNgxVuNn3wv7u9m7XP9pc4rS nzO4MIQ9xGOeDuImRZqB4T50+cdvYTKjzE9myL0CeoQAJB0xKxk1fgypi4WMu5Ryh4zjX ARKxgfQbqXYrcMhiWFoJeKiRh4hUUIEf3SK/tAT4qC23KFJ4CDQy+TdR3MBE2va7ymw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381796; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=/DfN7/f+BhryC+G93YBr91meKAjB56CGMk7dNW6ywO8=; b=VyxfJkU6nN5KMzEcbGU8JNpV5QlSVf05ftAB8wtpWBrWz4jsI3td3YTaOz99O/fGTcNy XG9hC6NvGcSMnHvm1UKfNR2LBDoBb26wQ+M9ybr6HnIxsMUgbU8npDrW1+shEANpwoVA+ RR1yNbSo6Yn1RBOP+m1rWqv04rGtHJ6kq0oJiVPgbUe8TrDqry/cLdbEetk227x2VrDRA WbsF+RN/gkgh/cq7HdlMJh9hamnbQPTC3xbO5KeQSx9d3DA1ob/nJt6A9NhPM1DmX8JbZ 5fn1tTNifJZfmSh2hoxwoL5qj7Bj/xk1lVAy9YZYPYBQQ0vMrxffvK5/sRV4Lv160CA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FZCkExCi; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C189606A330; Fri, 4 Dec 2026 10:56:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FZCkExCi Received: by smtp.kernel.org (Postfix) with ESMTPSA id B958B1F000C2; Fri, 4 Dec 2026 10:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381796; bh=/DfN7/f+BhryC+G93YBr91meKAjB56CGMk7dNW6ywO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FZCkExCitGQ3mJshwF075Fdt+z66rWoMxSj04wbSaYEmrpDzmLFx6oAnmIcFDlO2z LjmAWVjEn4IPS86gId82QW7evrAJkokvh1k834Hf79vQtSNXDuIrTmWj2vd6Ge2l7n y+Eo028Izj6Hozm6bMrxRShudkSa4WUeDTKDY6+Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ijae Kim , Myeonghun Pak , Jiri Kosina , Sasha Levin Subject: [PATCH 6.18 176/703] HID: magicmouse: disable the multitouch work on removal Date: Fri, 4 Dec 2026 19:01:15 +0900 Message-ID: <20261204100632.554115578@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak [ Upstream commit 348597b22005a8f20d267cdcc503a41dcc658acf ] During USB runtime reset-resume, usbhid can call magicmouse_reset_resume() without serialization against HID driver unbind. The USB interface remains bound to usbhid, so this callback can queue msc->work after magicmouse_remove() cancels it. The delayed work can then run after devres frees msc. Use disable_delayed_work_sync() to drain the work and reject later queueing. Probe initializes fresh work on rebind. Found by a static analysis tool under development. Fixes: 4253fe22b137 ("HID: magicmouse: re-enable multitouch after reset-resume") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-magicmouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index cf92c9c9ab2df..ff3dcbc30e724 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -1030,7 +1030,7 @@ static void magicmouse_remove(struct hid_device *hdev) struct magicmouse_sc *msc = hid_get_drvdata(hdev); if (msc) { - cancel_delayed_work_sync(&msc->work); + disable_delayed_work_sync(&msc->work); if (is_usb_magicmouse2(hdev->vendor, hdev->product) || is_usb_magictrackpad2(hdev->vendor, hdev->product)) timer_delete_sync(&msc->battery_timer); -- 2.53.0