Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3724579pxb; Mon, 24 Jan 2022 16:23:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxOLaso46muN6AP8KE6UY2pGV7mQqE8YNEpeYz6o1WZVLZKylaCVFYHIMuqONFQwxukVt2 X-Received: by 2002:a17:903:2446:b0:14a:7f24:4da1 with SMTP id l6-20020a170903244600b0014a7f244da1mr16834494pls.112.1643070221211; Mon, 24 Jan 2022 16:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070221; cv=none; d=google.com; s=arc-20160816; b=i0pvxowVQtqOOuBbrwmtbjVCysho3UQ6gBhedtAswnbkJ7CxniYt8QpcOsrzUVxy2O EuxaypoQNsXEDxbKvpjjY9xA8kZVzz0pQUZO3JAIaRXC/YB7izqac21R0AbGJFNe0zBF iGnJUrJOfDdCW2Lz1lo2FucNypQrGEL6zRdyosG2kcclSb7D2jmR7Y6zbJIEG95yLxgm gDgr72B7UL59ev9C2+Cm+Px+r9qXYvcYBJ+LJfqbVL/Txb2jC2du97zqmEcKoSX8j3wM EWJJ/DTSbqD930fxyjHVJZvgxrxjfDHkwyE8gQlEXlT7WTtV+2/gZVX48MpBKD903q7g i7fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ev48bY2pg0AFvKiLJr61geYrUij46gI9E3cgXWT3drk=; b=mYXCvSYPtbVTB31BWSeMrZGB/31YUIMwRLu+0gAO5NS+GexhrXO47CuIDQt0ajn/xV 3FT7RMlEvSz9y23xMfigYwyEM8LA9mkXVVmx9Pt1gvS6cAMb6BR+Nt1BJOC4OVZK+OAu 2QAyaiFKlwF67LBT5bHpKIT6xqCJ0ZT3eJq9ffrac2XoLI1JuD2iG+HTeMnoDy12VMmq /HDXIZLySTMZbUEQ9i6BvGzEeWeIfQ2tjiujJUIvvQcFSwlXwMCjfmYJ6BvjNtEPpb+q J1bOKbx3ND8ecLQ9A+VYenMZafQmFooqNKJqUVxt/TxHGrg4yFilsMffYLY4E5D9u+D/ +JBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1fueOis4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si15816885plh.508.2022.01.24.16.23.26; Mon, 24 Jan 2022 16:23:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1fueOis4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383884AbiAYARs (ORCPT + 99 others); Mon, 24 Jan 2022 19:17:48 -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: linux-kernel@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; }