From patchwork Thu Oct 27 15:05:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287120wru; Thu, 27 Oct 2022 08:11:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BUlMZG2MFcHARwB1z5X2qi8vGY2udzL18wnD58QMGez115A2JzlHBsgpR641G59eYoqDj X-Received: by 2002:a05:6402:500d:b0:459:3e56:e6f9 with SMTP id p13-20020a056402500d00b004593e56e6f9mr47141033eda.367.1666883511911; Thu, 27 Oct 2022 08:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883511; cv=none; d=google.com; s=arc-20160816; b=QHXDfCNl4+eD/uRnr7TzI5lGZa6z0KvIt7NJB55ETjQyovf0NOD6k7gI4eq30/PBQQ vQpvwMUqNkZrxZqVTnf4BhNRDANpMR05AMP4IET/styv3AC2x7spG6SFTf+WQhMiRdOD ZPlr/jx3pA2uhF7/5q22Ceton4PMN0+h+gxP2v0VRui5AHYtI6FGup2gmROWY6weT+Yh OE6vuNzb5KDXXAjcdGET9yNTGX42ndeUY2l5NoiJ/7fIW7gRFyx/DmjlDAPCwtjjJcpM bVhMC/Mv6jBabYneszf141wAMbGPnRPuko0dZoF2EtwmNQPl21XLAp+RzC0P+SSpSg1t oxDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=R9/dyHU0ttQhAMauVjiics3a+M2cPLLX5UeGSlLMrCo=; b=ord9m2FEwp5urGcGxxxu/YEN4MJqoztrZSXbxC5Ovg6jDXbc9Uhx5V6LQ+7u+X+PY1 ttwoKDSfcZkQORxV68A6p+bXCyU+S4p9J69OE7aTSaRJxsejZ5XSm546RMjYlG6hMIbm M338lUy6TlcDoaCRV96ajP2sHrLef8AqWAPNg3p8M1aYEZAFpbpu2PyoFkeSe7LWS2Wz 4V85d5wrowgXrGffhSHsdqjRmSwiasPhy3Yo0sl0xrliIruD95hHgzrIfvILBhzacMxQ grcfHf9/2MvGb0WmkBAf5EUoDtN/BHmN/qpeRjrNNRQQ8XFEfVFnPXkfuGNrGhzaFSAg 3PxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne19-20020a1709077b9300b0078dcaaa2638si1736968ejc.708.2022.10.27.08.11.27; Thu, 27 Oct 2022 08:11:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236425AbiJ0PKj (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236072AbiJ0PJR (ORCPT ); Thu, 27 Oct 2022 11:09:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8114618F27E for ; Thu, 27 Oct 2022 08:09:14 -0700 (PDT) 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 3E0C1B826AF for ; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC0A3C4347C; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vb-00BvX8-0S; Thu, 27 Oct 2022 11:09:27 -0400 Message-ID: <20221027150926.969147187@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:35 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Corey Minyard , openipmi-developer@lists.sourceforge.net Subject: [RFC][PATCH v2 10/31] timers: ipmi: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747854045809973514?= X-GMAIL-MSGID: =?utf-8?q?1747854045809973514?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Corey Minyard Cc: openipmi-developer@lists.sourceforge.net Signed-off-by: Steven Rostedt (Google) Acked-by: Corey Minyard --- drivers/char/ipmi/ipmi_msghandler.c | 2 +- drivers/char/ipmi/ipmi_ssif.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 49a1707693c9..b577f66f3ca6 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -5540,7 +5540,7 @@ static void __exit cleanup_ipmi(void) * here. */ atomic_set(&stop_operation, 1); - del_timer_sync(&ipmi_timer); + del_timer_shutdown(&ipmi_timer); initialized = false; diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index e1072809fe31..bb4df879a5ab 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1273,8 +1273,8 @@ static void shutdown_ssif(void *send_info) schedule_timeout(1); ssif_info->stopping = true; - del_timer_sync(&ssif_info->watch_timer); - del_timer_sync(&ssif_info->retry_timer); + del_timer_shutdown(&ssif_info->watch_timer); + del_timer_shutdown(&ssif_info->retry_timer); if (ssif_info->thread) { complete(&ssif_info->wake_thread); kthread_stop(ssif_info->thread);