From patchwork Fri Nov 4 05:41:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191252wru; Thu, 3 Nov 2022 22:52:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7pSsTh9tRjhp0V0Xj0r9JMXPN0UuK9+KTpzaxArwsrtJ8xVtjn75SIeyHQyqgWKzX+m0V6 X-Received: by 2002:a05:6402:1cb0:b0:463:5904:d0fd with SMTP id cz16-20020a0564021cb000b004635904d0fdmr26188839edb.302.1667541157065; Thu, 03 Nov 2022 22:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541157; cv=none; d=google.com; s=arc-20160816; b=VSfyks+ptowizDAW/iYwAvdTKG9KSbMCMoOQbYen0Q3EgkzZCBxWdkVQZEr3R1OfMn U14fyMdR8EnxmnFuzMi0yTri4hpZq/hJwRnBnsGQpfLGzPR2oX06t+nUx30lJNwpbDvH IqH/SP+/fD2HAJE9htAWxEaUTH0XG5No5Z+jFh9bIsYzNavg7WcZv27Bc5IcVRdjsWPk /U2+XHTmAE9fpHXo2HNcTJs3qcRL6mmyb7fmxEycO69MT1yyHBdIkdvzQFs486/GjoyQ RUQ+No9BII1myr7x0MIUmnniwiFePIte2HHFo+XzSSlremQzNLspCvlv2MYR+5cuQPVS 6RGA== 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=LpANLnNtMR45ZcQCmmjdgA2Lr6XdEWm9SbTLGCGfjWE=; b=ZWey0FVCqs16+Hed/kgIBaxhxeXrpi8dXhXbQupgA3qY+LpsXVkvnZFb9T8FuhwdYa u+EhqFwx4tXvmjPjgY5FsoF5iIXheaNuUYHvYJTvCtVP8+h74oB5EXHeUpjgbDvwWJji 1gWgeUIrnzqb8RwOU04JGH7ylEAyl0sepG9QWoUJU1cKyl4YvQ06T2Mqfu0atPkfmHDo X+uErViqeIG8l3/g5K1HqbRuD/8l2bWG7EEAzuVYC05hA60Xe1kyQBKFWl42fRjjPmEE aZt/AWXmvswkWKQa2+3tQft3aKCpl2BNJca4bpJBlXzv/dcjgsGGqxp/3UvQKBc75LDc Mw4g== 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 sb42-20020a1709076daa00b0073d71124609si3322188ejc.182.2022.11.03.22.52.13; Thu, 03 Nov 2022 22:52:37 -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 S231347AbiKDFul (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231346AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EA0728E03 for ; Thu, 3 Nov 2022 22:48:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 699FD620BE for ; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45474C433D7; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071CO-2b; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.648628562@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:19 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Greg Kroah-Hartman , Jiri Slaby Subject: [RFC][PATCH v3 26/33] timers: tty: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@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?1748543636349987039?= X-GMAIL-MSGID: =?utf-8?q?1748543636349987039?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Steven Rostedt (Google) --- drivers/tty/n_gsm.c | 2 +- drivers/tty/sysrq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 5e516f5cac5a..6f48adecd1d4 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2098,7 +2098,7 @@ static void gsm_dlci_free(struct tty_port *port) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); - del_timer_sync(&dlci->t1); + timer_shutdown_sync(&dlci->t1); dlci->gsm->dlci[dlci->addr] = NULL; kfifo_free(&dlci->fifo); while ((dlci->skb = skb_dequeue(&dlci->skb_list))) diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index d2b2720db6ca..b6e70c5cfa17 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -1003,7 +1003,7 @@ static void sysrq_disconnect(struct input_handle *handle) input_close_device(handle); cancel_work_sync(&sysrq->reinject_work); - del_timer_sync(&sysrq->keyreset_timer); + timer_shutdown_sync(&sysrq->keyreset_timer); input_unregister_handle(handle); kfree(sysrq); }