The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Hongyan Xu <getshell@seu.edu.cn>
To: Jiri Kosina <jikos@kernel.org>, David Sterba <dsterba@suse.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: Ben Martel <benm@symmetric.co.nz>,
	Stephen Blackheath <stephen@symmetric.co.nz>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	stable@vger.kernel.org, jianhao.xu@seu.edu.cn,
	Hongyan Xu <getshell@seu.edu.cn>
Subject: [PATCH] tty: ipwireless: shut down setup timer before freeing hardware
Date: Thu,  6 Aug 2026 14:07:40 +0800	[thread overview]
Message-ID: <20260806060741.714-1-getshell@seu.edu.cn> (raw)

ipwireless_stop_interrupts() uses timer_delete() for a timer whose callback
can rearm itself. timer_delete() neither waits for a running callback nor
prevents that callback from rearming the timer. The callback can therefore
continue to access struct ipw_hardware after ipwireless_hardware_free() has
freed it.

Use timer_shutdown_sync() so teardown waits for the callback and prevents
any further rearming.

Fixes: 099dc4fb6265 ("ipwireless: driver for PC Card 3G/UMTS modem")
Cc: stable@vger.kernel.org
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
---
 drivers/tty/ipwireless/hardware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index 0bfcbca6e2df..fb3554a6e04b 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1721,7 +1721,7 @@ void ipwireless_stop_interrupts(struct ipw_hardware *hw)
 	if (!hw->shutting_down) {
 		/* Tell everyone we are going down. */
 		hw->shutting_down = 1;
-		timer_delete(&hw->setup_timer);
+		timer_shutdown_sync(&hw->setup_timer);
 
 		/* Prevent the hardware from sending any more interrupts */
 		do_close_hardware(hw);
-- 
2.50.1.windows.1


             reply	other threads:[~2026-08-06  6:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  6:07 Hongyan Xu [this message]
2026-08-06  6:16 ` [PATCH] tty: ipwireless: shut down setup timer before freeing hardware Greg Kroah-Hartman
2026-08-06  7:54 ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260806060741.714-1-getshell@seu.edu.cn \
    --to=getshell@seu.edu.cn \
    --cc=benm@symmetric.co.nz \
    --cc=dsterba@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=jikos@kernel.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stephen@symmetric.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox