From patchwork Sat Nov 5 06:00:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 621958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A130C4332F for ; Sat, 5 Nov 2022 06:01:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229718AbiKEGBw (ORCPT ); Sat, 5 Nov 2022 02:01:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiKEGBc (ORCPT ); Sat, 5 Nov 2022 02:01:32 -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 D14E030F46; Fri, 4 Nov 2022 23:01:30 -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 B5A0B60A25; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 900FAC43470; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFh-007OnI-2T; Sat, 05 Nov 2022 02:01:57 -0400 Message-ID: <20221105060157.600537824@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:39 -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: [PATCH v4a 15/38] timers: leds: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Pavel Machek Cc: linux-leds@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/leds/trigger/ledtrig-pattern.c | 2 +- drivers/leds/trigger/ledtrig-transient.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); }