Message ID | 20221027150930.128814334@goodmis.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp288556wru; Thu, 27 Oct 2022 08:14:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hKRHRB9pvWWEvxFHxCouuDZMkMYFh7JkJibZ1o0iIpsOo+Qy4lzyp6yOERJSeWzNZ9QNb X-Received: by 2002:a05:6402:3213:b0:461:dec8:336d with SMTP id g19-20020a056402321300b00461dec8336dmr18653323eda.221.1666883657064; Thu, 27 Oct 2022 08:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883657; cv=none; d=google.com; s=arc-20160816; b=saVbITSFiUymz8TJq7lcAx4un83AeAHv2ZIlfpXttLhmaCPzU9OAuFRCieysxRswNi TUIH8lN5Yod5ELn18C+E0N6rbfBYPZH2k9SlDmP43Pe4zQSbW/0dqzgjLdGDQX70DhLO GwycBVdY8BRz7hSzUh+7+FRdUWtrdnYr2TAysUAMmhcQPmziX11ryeq3yQh/mC5eSxdv A1IZ1lBLs+4KlhSSrlcGo0C6pCeYE4FIHHc/e8CUk+iZ9GS/AYZQlFxVpvlJFsj4JNQo pT0WHi7Dt8+I/N6Eiuae1fgo89wA/fgn4sK9LGRgm1Tw26hh2rWd1tFGiIIWKRi+2AlC I6Lg== 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=t2ZZCrPVY0HVi/XJvqNDhAGre/ipex3cWMwE3RJtDBY=; b=S72E24VW0P6moz5UpfOZ7xsUU3ReZHOWn1ry89jwVFvrx5EVgbmiP1TvZEmZVgETrH taN3qHGMf95e8So65Vl9EdwQ7BnpPVE1sXouhZfeHKVGXdV+KjPokTPbnKAnUOy00wo1 /3u3fnwmZNs7MSJahIIxBMsI0B+kgfwsY9d5XMJHvMBQOADKz58homZuTwbaM3zp6Rrw 3eKsfD+tbpsEi4Fsyv61uXj6W3Sqm7HGjHQmgbPYKKwnkq0ONAPKM7jc38YeGEB/Lcl8 ArWGW1sf3doRaGy11pdLCbzyP483T6XrRDOABdfUkMFZ3iBhMc3PdmCPn3xQ4vdgxbKI zgFg== 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 wt5-20020a170906ee8500b0078db719e54csi1958769ejb.98.2022.10.27.08.13.51; Thu, 27 Oct 2022 08:14:17 -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 S236016AbiJ0PL2 (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 27 Oct 2022 11:11:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236120AbiJ0PJS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Oct 2022 11:09:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B757190447 for <linux-kernel@vger.kernel.org>; Thu, 27 Oct 2022 08:09:16 -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 A2A5662377 for <linux-kernel@vger.kernel.org>; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 191DBC43143; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from <rostedt@goodmis.org>) id 1oo4Ve-00BvgA-0z; Thu, 27 Oct 2022 11:09:30 -0400 Message-ID: <20221027150930.128814334@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:51 -0400 From: Steven Rostedt <rostedt@goodmis.org> To: linux-kernel@vger.kernel.org Cc: Linus Torvalds <torvalds@linux-foundation.org>, Thomas Gleixner <tglx@linutronix.de>, Stephen Boyd <sboyd@kernel.org>, Guenter Roeck <linux@roeck-us.net>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org> Subject: [RFC][PATCH v2 26/31] timers: tty: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747854197299659471?= X-GMAIL-MSGID: =?utf-8?q?1747854197299659471?= |
Series |
timers: Use del_timer_shutdown() before freeing timers
|
|
Commit Message
Steven Rostedt
Oct. 27, 2022, 3:05 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org> Before a timer is freed, del_timer_shutdown() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> --- drivers/tty/n_gsm.c | 2 +- drivers/tty/sysrq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On 27. 10. 22, 17:05, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" <rostedt@goodmis.org> > > Before a timer is freed, del_timer_shutdown() must be called. > > Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Jiri Slaby <jirislaby@kernel.org> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> > --- > 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..1d167469a700 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); > + del_timer_shutdown(&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..20b1c9802506 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); > + del_timer_shutdown(&sysrq->keyreset_timer); > input_unregister_handle(handle); > kfree(sysrq); > } thanks,
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 5e516f5cac5a..1d167469a700 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); + del_timer_shutdown(&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..20b1c9802506 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); + del_timer_shutdown(&sysrq->keyreset_timer); input_unregister_handle(handle); kfree(sysrq); }