From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A45FC4167D for ; Tue, 25 Jan 2022 00:09:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2370712AbiAYAGB (ORCPT ); Mon, 24 Jan 2022 19:06:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1851179AbiAXXcH (ORCPT ); Mon, 24 Jan 2022 18:32:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B6BC075D0F; Mon, 24 Jan 2022 13:35:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C97D6614DA; Mon, 24 Jan 2022 21:35:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A85BAC340E4; Mon, 24 Jan 2022 21:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060118; bh=96rE6TDrpIIZ1lVQxWZtDllQnUUU4B7R+pVb1uXRYLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1fueOis4oiOLchMyxq7SMGBxnkkC2+IZXDsoCNes8CI9xASljuP/SZAvNIAdGlq/S aQFFrzwBNtAhpeEJLdx8lmd7S7FLnSfq8YUVYJvE5Q2ffFiq56d3o7annZeS6xisjG LrUTxqBG826EnvuVEQaMs4F92JS7qCqYG5I4ixDs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= , syzbot+a437546ec71b04dfb5ac@syzkaller.appspotmail.com, Jiri Kosina Subject: [PATCH 5.16 0846/1039] HID: magicmouse: Fix an error handling path in magicmouse_probe() Date: Mon, 24 Jan 2022 19:43:55 +0100 Message-Id: <20220124184153.721264012@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET commit 33812fc7c8d77a43b7e2bf36a0d5a57c277a4b0c upstream. If the timer introduced by the commit below is started, then it must be deleted in the error handling of the probe. Otherwise it would trigger once the driver is no more. Fixes: 0b91b4e4dae6 ("HID: magicmouse: Report battery level over USB") Signed-off-by: Christophe JAILLET Tested-by: José Expósito Reported-by: Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-magicmouse.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -873,6 +873,7 @@ static int magicmouse_probe(struct hid_d return 0; err_stop_hw: + del_timer_sync(&msc->battery_timer); hid_hw_stop(hdev); return ret; }