From patchwork Thu Oct 27 15:05:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11832 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286858wru; Thu, 27 Oct 2022 08:11:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CDYMh6LAWs0hKPAGBEk8PnKPP40yGAJiw/al9h/QzN1V/c7QMg2sSYXH9qgqhh9XYv7wo X-Received: by 2002:a17:907:31c3:b0:770:852b:71a2 with SMTP id xf3-20020a17090731c300b00770852b71a2mr42716719ejb.557.1666883485606; Thu, 27 Oct 2022 08:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883485; cv=none; d=google.com; s=arc-20160816; b=efMyjayJ+fjlypU9mPTvopGXagBWOyh+ctIr/8IVN4loXuXDRgC/4tE1d0ZoEvpWns A8Wv/sXpW3SJWp76WUBi9mQmL2Cz2VdUnNbvGP1/uuKUCgyfDC+Fg+/71HPvkHxBSyt9 wDSN6abWo1akmg5QTuHUDKE2uDT3ovfVEXH2HGvi7aJUwKcEEYgtWMNvz6NvwJ7pFFxR kCwiPP/TAIC41t3KWDuRe/KLqRMV4qHbhc/0RcqUFGvZB3u0Ykg+k+MFLGjphhD6JTAq kgz57CcxoTNxIy9MgvubQufhTQlZYWp4CIhHb5BUbpmKuiVit0rzCoLJO1tyN8TO5PtO T7og== 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=xnopSeg2aZXY+jiDF8Zc50BE0Q4WCFRWd+VW7bVfyzc=; b=gHsNJnboJOowGA8ZQkU26C6MaHY6DCs1hNLvZ1yuvUJNRs4AE8O8wrOsFUDqPdvJwQ zx7r1qhMqXdpm5+jtSZESJjDlB8Xb82zK4qH3Hn4+JGueisxG+vn17f8B6SzjEGdZ5e2 9tW0IzK3cYMNrZl2EBJvwW3M+B1OacD6cGZQi4KGWZa8IOnrRdXzRcVH1RDS51L+YE2v IS0rI6WDd7LbMUv7Jw1KBvVka7duBhigg8YMjy5g/NoeZjf6jxM+J+5qq2t+K4slGRGb UjPYEboGSN2eL895y/PD5iWs6jt50Ee32YEbSl6B+A9RWF4JmwtT3PL+cYClNw7mFpfr PggA== 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 ga20-20020a1709070c1400b0072f38ecf74asi1829844ejc.794.2022.10.27.08.11.00; Thu, 27 Oct 2022 08:11:25 -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 S236405AbiJ0PK0 (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236026AbiJ0PJQ (ORCPT ); Thu, 27 Oct 2022 11:09:16 -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 DF25718F0E9; 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 773B1623A7; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 526EFC433D7; 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-00Bvb5-1j; Thu, 27 Oct 2022 11:09:28 -0400 Message-ID: <20221027150928.367913405@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:42 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Pavel Machek , linux-leds@vger.kernel.org Subject: [RFC][PATCH v2 17/31] timers: leds: 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?1747854017425579204?= X-GMAIL-MSGID: =?utf-8?q?1747854017425579204?= 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: Pavel Machek Cc: linux-leds@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/leds/trigger/ledtrig-activity.c | 2 +- drivers/leds/trigger/ledtrig-heartbeat.c | 2 +- drivers/leds/trigger/ledtrig-pattern.c | 2 +- drivers/leds/trigger/ledtrig-transient.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c index 30bc9df03636..dc2c7b5ef67e 100644 --- a/drivers/leds/trigger/ledtrig-activity.c +++ b/drivers/leds/trigger/ledtrig-activity.c @@ -208,7 +208,7 @@ static void activity_deactivate(struct led_classdev *led_cdev) { struct activity_data *activity_data = led_get_trigger_data(led_cdev); - del_timer_sync(&activity_data->timer); + del_timer_shutdown(&activity_data->timer); kfree(activity_data); clear_bit(LED_BLINK_SW, &led_cdev->work_flags); } diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c index 7fe0a05574d2..7c46457f31a1 100644 --- a/drivers/leds/trigger/ledtrig-heartbeat.c +++ b/drivers/leds/trigger/ledtrig-heartbeat.c @@ -151,7 +151,7 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev) struct heartbeat_trig_data *heartbeat_data = led_get_trigger_data(led_cdev); - del_timer_sync(&heartbeat_data->timer); + del_timer_shutdown(&heartbeat_data->timer); kfree(heartbeat_data); clear_bit(LED_BLINK_SW, &led_cdev->work_flags); } diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c index 43a265dc4696..f50da27fea47 100644 --- a/drivers/leds/trigger/ledtrig-pattern.c +++ b/drivers/leds/trigger/ledtrig-pattern.c @@ -430,7 +430,7 @@ static void pattern_trig_deactivate(struct led_classdev *led_cdev) if (led_cdev->pattern_clear) led_cdev->pattern_clear(led_cdev); - del_timer_sync(&data->timer); + del_timer_shutdown(&data->timer); led_set_brightness(led_cdev, LED_OFF); kfree(data); diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 80635183fac8..1f28f13b1764 100644 --- a/drivers/leds/trigger/ledtrig-transient.c +++ b/drivers/leds/trigger/ledtrig-transient.c @@ -180,7 +180,7 @@ static void transient_trig_deactivate(struct led_classdev *led_cdev) { struct transient_trig_data *transient_data = led_get_trigger_data(led_cdev); - del_timer_sync(&transient_data->timer); + del_timer_shutdown(&transient_data->timer); led_set_brightness_nosleep(led_cdev, transient_data->restore_state); kfree(transient_data); }