From patchwork Fri Nov 4 05:41:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp192165wru; Thu, 3 Nov 2022 22:55:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6baCZH6Xf7UQYCqDoPcsqntNomqb7fAfcjaxioSgOo4USXi1s4ohwIvP7aIE8rp3tOJXW1 X-Received: by 2002:a05:6402:3709:b0:459:279e:fdc6 with SMTP id ek9-20020a056402370900b00459279efdc6mr34501820edb.338.1667541347259; Thu, 03 Nov 2022 22:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541347; cv=none; d=google.com; s=arc-20160816; b=OjcUk7TxKRGhNYWbXL0OiAqsvitpeB2PC7uOaOCVJ3f7keDzEdTbAoIZ0J2A3x/tq1 hjoTNy+n+/czodkCo1mHa0/Rlma0yiFzNviYNOEOhM8u5c5akCPCJQmfJMYaa0pEIBWr JOKK21XJD5Zfpo1ue4F+Xzh4utB7NAMfrIekxveJoV5kYCpKSX61891+2+pJbhE3K0bE Q9jNeCV1qLuYms99OdIV+oYUfI00VQNoEStYXRS+rE79HAmevVXJpEI3xQ2c4ZO32uC+ 3hanXTTeMB8DFrF9MgJ7Zn84bnNgD7ZzhBzIFyQicZr/aCgNA2ZsG5b2DwQnJ1BIddYh isVQ== 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=WLEbVkOK6HuRRIs31lOdzMR9qw5dl+COq+13Yqz168M=; b=GY0L4eaYXylSfxnNEjy1nh7Xx6j2hWWqfBc6oUoML+/TEycYULI1vR7Y3NTuch8qEX td+L1T5uWcuJj/h33mKBgiRaihlhRgJdXkPAunmXpUrAqH8FGIMEklwa9/YsRaB9ch35 VF2HBUU1imJ8YN7lUa43bNq8P2R1GL6X2db6CQSA3bnEs3ScefFZExcQxOENHVYbC5yB 2QgNczUq0UCYy+NUwh90kPvRmgSt1yvhfWm5zWLCFeFDWnknCqDBgCsZg4C244BiJli9 3rJf+G61kzdx4Cq7A+48FCtmb7Fk78FuzBNbHywXLAR7f12imwFfnm02AWNviCzpVfEi GfHw== 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 qa31-20020a170907869f00b0078e093ae419si4683967ejc.8.2022.11.03.22.55.23; Thu, 03 Nov 2022 22:55:47 -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 S231655AbiKDFuv (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231313AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567DA28731; Thu, 3 Nov 2022 22:48:51 -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 06717B82C03; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD633C433D7; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZr-00717J-0Y; Fri, 04 Nov 2022 01:49:15 -0400 Message-ID: <20221104054915.007849347@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:10 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Pavel Machek , linux-leds@vger.kernel.org Subject: [RFC][PATCH v3 17/33] timers: leds: 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?1748543835279613437?= X-GMAIL-MSGID: =?utf-8?q?1748543835279613437?= 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: 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..33cbf8413658 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); + timer_shutdown_sync(&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..393b3ae832f4 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); + timer_shutdown_sync(&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..e996d61e3bd6 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); + timer_shutdown_sync(&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..f111fa7635e5 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); + timer_shutdown_sync(&transient_data->timer); led_set_brightness_nosleep(led_cdev, transient_data->restore_state); kfree(transient_data); }