From patchwork Tue Nov 23 12:50:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 12634135 X-Patchwork-Delegate: kuba@kernel.org 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 231BCC433EF for ; Tue, 23 Nov 2021 12:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235777AbhKWMyS (ORCPT ); Tue, 23 Nov 2021 07:54:18 -0500 Received: from pi.codeconstruct.com.au ([203.29.241.158]:55716 "EHLO codeconstruct.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235122AbhKWMyQ (ORCPT ); Tue, 23 Nov 2021 07:54:16 -0500 Received: by codeconstruct.com.au (Postfix, from userid 10000) id 2591720271; Tue, 23 Nov 2021 20:51:07 +0800 (AWST) From: Jeremy Kerr To: netdev@vger.kernel.org Cc: Jiri Slaby , Greg Kroah-Hartman , Matt Johnston , "David S. Miller" , Jakub Kicinski Subject: [PATCH net-next 1/3] mctp: serial: cancel tx work on ldisc close Date: Tue, 23 Nov 2021 20:50:40 +0800 Message-Id: <20211123125042.2564114-2-jk@codeconstruct.com.au> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211123125042.2564114-1-jk@codeconstruct.com.au> References: <20211123125042.2564114-1-jk@codeconstruct.com.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 Signed-off-by: Jeremy Kerr --- 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); }