From patchwork Thu Oct 27 15:05:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286531wru; Thu, 27 Oct 2022 08:10:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ryjC494108DljhTSB6kIyJB0goMgVyuZmEOsz0CeiE10QsdW+/OcFg/C4/l6VpWuxTYHL X-Received: by 2002:a05:6402:1052:b0:459:2c49:1aed with SMTP id e18-20020a056402105200b004592c491aedmr46116515edu.212.1666883457948; Thu, 27 Oct 2022 08:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883457; cv=none; d=google.com; s=arc-20160816; b=izR5h3oqmvJznIuIE3HuS1Daeh7DZPuxRu8+369zNwy6ba7Gh4f7alLo4GCu9wRG4j Mue2kLttz/xGIta2H2ppsGUZ5ROVRB63j4yx+zbyTVIGS+OUJtGCYd+wN/pCpckeGzMY VVKOXJwwC1pINr/fIzR3FQVr1SEYGihaGYD7g1lKuTUwL2t6rROmO4LlOQmAJUA8H7fM GyomGaSW5C3HgRQWAqsGgwTeN732OgRgVcSn0XrWqhqSCtQD2UK/aUZCAgffCYAN80Lr Fl04J4FGEUc7nu7BOcbR80ISqpNwH1ETafk0OXI61q6qLJNiRtLsmOcRgvMDdcbNc+yG HQAA== 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=NLpZDBrOTjUXxsZQETl74CNlxAzKKzeUZPc2B7eALow=; b=0Hn0oY7xOwFwCOK3/mE9gBqz9xovR8vPZZQPLZd16WyiMaGtE+Wm5UAs1zA0x5SlQC PNsqYA56YsC6XHUORsr7Qd0RvcqvVrt8UIgA1++aMUpjbIuqmbfPOPHz2eiBsfs9i00f 5ol4GbilAtnP76Qy6sEmzClUsfrkcoXUV74NjnRJP4Bkd5p28J51E8c8jThfL+UCbsMU RM8tFqFA/KxB/5Z90iSY8xsRY4w/xJj2ztsw8fwn12uWB8W+i23wONse0fJ4AmR8Iv8E rVjZBaI4xEEPYv7UJQZhCHkDs6OOqD+CQuN8916KvJuuJv0atz0WYP2O9DgXR58C1t4R oVew== 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 xg11-20020a170907320b00b0076f16ec62d6si1673970ejb.959.2022.10.27.08.10.33; Thu, 27 Oct 2022 08:10:57 -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 S236345AbiJ0PJx (ORCPT + 99 others); Thu, 27 Oct 2022 11:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236002AbiJ0PJP (ORCPT ); Thu, 27 Oct 2022 11:09:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B54D918F263; Thu, 27 Oct 2022 08:09:13 -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 4FE3362393; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C4ECC433D6; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vc-00BvaW-18; Thu, 27 Oct 2022 11:09:28 -0400 Message-ID: <20221027150928.182961808@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:41 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Karsten Keil , netdev@vger.kernel.org Subject: [RFC][PATCH v2 16/31] timers: mISDN: 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?1747853988803198056?= X-GMAIL-MSGID: =?utf-8?q?1747853988803198056?= 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: Karsten Keil Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/isdn/hardware/mISDN/hfcmulti.c | 2 +- drivers/isdn/mISDN/l1oip_core.c | 4 ++-- drivers/isdn/mISDN/timerdev.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 4f7eaa17fb27..8a212c17a093 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -4544,7 +4544,7 @@ release_port(struct hfc_multi *hc, struct dchannel *dch) spin_lock_irqsave(&hc->lock, flags); if (dch->timer.function) { - del_timer(&dch->timer); + del_timer_shutdown(&dch->timer); dch->timer.function = NULL; } diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index a77195e378b7..2d4b19e7d48b 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -1236,8 +1236,8 @@ release_card(struct l1oip *hc) hc->shutdown = true; - del_timer_sync(&hc->keep_tl); - del_timer_sync(&hc->timeout_tl); + del_timer_shutdown(&hc->keep_tl); + del_timer_shutdown(&hc->timeout_tl); cancel_work_sync(&hc->workq); diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index abdf36ac3bee..9d69efb8a1bc 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -74,7 +74,7 @@ mISDN_close(struct inode *ino, struct file *filep) while (!list_empty(list)) { timer = list_first_entry(list, struct mISDNtimer, list); spin_unlock_irq(&dev->lock); - del_timer_sync(&timer->tl); + del_timer_shutdown(&timer->tl); spin_lock_irq(&dev->lock); /* it might have been moved to ->expired */ list_del(&timer->list); @@ -204,7 +204,7 @@ misdn_del_timer(struct mISDNtimerdev *dev, int id) list_del_init(&timer->list); timer->id = -1; spin_unlock_irq(&dev->lock); - del_timer_sync(&timer->tl); + del_timer_shutdown(&timer->tl); kfree(timer); return id; }