netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: netdev@vger.kernel.org
Cc: Jiri Slaby <jirislaby@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matt Johnston <matt@codeconstruct.com.au>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 1/3] mctp: serial: cancel tx work on ldisc close
Date: Tue, 23 Nov 2021 20:50:40 +0800	[thread overview]
Message-ID: <20211123125042.2564114-2-jk@codeconstruct.com.au> (raw)
In-Reply-To: <20211123125042.2564114-1-jk@codeconstruct.com.au>

We want to ensure that the tx work has finished before returning from
the ldisc close op, so do a synchronous cancel.

Reported-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
 drivers/net/mctp/mctp-serial.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mctp/mctp-serial.c b/drivers/net/mctp/mctp-serial.c
index 9ac0e187f36e..c958d773a82a 100644
--- a/drivers/net/mctp/mctp-serial.c
+++ b/drivers/net/mctp/mctp-serial.c
@@ -478,6 +478,7 @@ static void mctp_serial_close(struct tty_struct *tty)
 	struct mctp_serial *dev = tty->disc_data;
 	int idx = dev->idx;
 
+	cancel_work_sync(&dev->tx_work);
 	unregister_netdev(dev->netdev);
 	ida_free(&mctp_serial_ida, idx);
 }
-- 
2.33.0


  reply	other threads:[~2021-11-23 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 12:50 [PATCH net-next 0/3] mctp serial minor fixes Jeremy Kerr
2021-11-23 12:50 ` Jeremy Kerr [this message]
2021-11-24  5:36   ` [PATCH net-next 1/3] mctp: serial: cancel tx work on ldisc close Jiri Slaby
2021-11-24  6:35     ` Jiri Slaby
2021-11-24  6:38     ` Jeremy Kerr
2021-11-25  5:43       ` Jiri Slaby
2021-11-25  5:55         ` Jeremy Kerr
2021-11-23 12:50 ` [PATCH net-next 2/3] mctp: serial: enforce fixed MTU Jeremy Kerr
2021-11-23 12:50 ` [PATCH net-next 3/3] mctp: serial: remove unnecessary ldisc data check Jeremy Kerr

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=20211123125042.2564114-2-jk@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kuba@kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).