Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3694528pxb; Mon, 24 Jan 2022 15:34:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGp3z9q+VGTiv8TgCnJHaiyf9vtn23YoCWdGXDuVxE8BVF+XrhnNohcKg7Bqv+JdArAp4+ X-Received: by 2002:a62:1681:0:b0:4bc:ceec:257c with SMTP id 123-20020a621681000000b004bcceec257cmr16109544pfw.84.1643067278307; Mon, 24 Jan 2022 15:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067278; cv=none; d=google.com; s=arc-20160816; b=nEVUS4TYs1eE1C5xwaHBZtc+R6kmgiOcfsG9Si8Is6CwunEy4Fc34f4sMjeE+0SDyf 8IPkkQ+12RZGHqRVTpT8ph2sKmoCFg+OXbg+p0O5IE/t78/yJ/m9IyN6tM+5qEkWxf7O b1C86cdkp7Na2VzOW9cC7B0omDZHQIKiht5FO6uNw6kWCJgS/XXgAvGKgrhC9y8MSprt iqTDWin6XFRytAkUp4A+mieWVKSkRtOqJYjYMyfH6i+xBw+guCFiIreReWv6IJVbrTep 4fSsTlCDStOAxip3vG3rOn00NLl6X5PNkVHwmqeFGMo6EDeBbJObocjdmXY/hSzkHhQo F+ww== 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=iTokYFIjttdmdCOqcOW5m1xdqCP1dvLGCWRnClB4oZAfFxXoxLPgVerT60xQnu+qmK 71imraKxf1dgLGpeUFNls7YKZPI7en2Wsw010yAb7f+jSId4ylcgvpCAHRDztoCtgB+l vu96aOjRMuQKb3cuoiER9lhmu9X9e67n3JIHk2vdrOhdKnJO/B1mK90rWLJ47OFrbBFD qN4ieMdDXl9Ov0eGSgl+d515duq04er9pfFKh6JLsz0oLeMEa0HHP2X+2vDlMJjCZswV 5551Fl7oVi8Q3+ypGeppgiI0USeGWyap/7aUTKdIkl2CRUYSRSS56ZEofP62Xr1tr0Au ulXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ULb5B08S; 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 b7si15310953plz.249.2022.01.24.15.34.26; Mon, 24 Jan 2022 15:34:38 -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=ULb5B08S; 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 S1385688AbiAXX31 (ORCPT + 99 others); Mon, 24 Jan 2022 18:29:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1452034AbiAXWNN (ORCPT ); Mon, 24 Jan 2022 17:13:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C06C0E03EB; Mon, 24 Jan 2022 12:43:56 -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 ams.source.kernel.org (Postfix) with ESMTPS id DDF93B80FA1; Mon, 24 Jan 2022 20:43:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08E49C340E7; Mon, 24 Jan 2022 20:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057034; bh=96rE6TDrpIIZ1lVQxWZtDllQnUUU4B7R+pVb1uXRYLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ULb5B08SWQdAPikeD3CwgusOPgqHQNCTAjEFII3W+ZYfMk99R71yqg6uExru8fotp wF70meEU5BLiLP1ukjS69x+8mEjtltipiNga7RL5EXIr1RFN0dcAJTjaCo848+N0CJ VXrXn5zhkOUpy6l2kNqF5sHfwyj5Tlx4iZo2HnTQ= 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.15 679/846] HID: magicmouse: Fix an error handling path in magicmouse_probe() Date: Mon, 24 Jan 2022 19:43:16 +0100 Message-Id: <20220124184124.495603286@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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; }