linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Staudt <max@enpas.org>
To: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: dario.binacchi@amarulasolutions.com,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Richard Palethorpe <richard.palethorpe@suse.com>,
	Petr Vorel <petr.vorel@suse.com>,
	Wolfgang Grandegger <wg@grandegger.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	stable@vger.kernel.org, ltp@lists.linux.it
Subject: Re: [PATCH] can: slcan: fix freed work crash
Date: Fri, 2 Dec 2022 03:52:42 +0900	[thread overview]
Message-ID: <20221202035242.155d54f4.max@enpas.org> (raw)
In-Reply-To: <20221201073426.17328-1-jirislaby@kernel.org>

(CC: ltp@lists.linux.it because Petr did so.)

Hi Jiry,

Thanks for finding this!


Your patch looks correct to me, so please have a

  Reviewed-by: Max Staudt <max@enpas.org>

for both this patch to slcan, as well as an 1:1 patch to can327.



Some history:

This is actually my code from can327, which was backported to slcan as
part of Dario's larger modernisation effort.

The rationale for moving it was to flush the UART TX buffer in case of
ndo_close(), in order to bring the device into a more predictable state
between ndo_close() and ndo_open(). I guess that's actually
counterproductive - whatever is in the TX buffer at that time should
likely be fully sent. For example, can327 sends one last byte to abort
any running chatty monitoring mode from the adapter. So your patch also
fixes this as well ;)

Of course, this resulted in calling flush_worker() in both ndo_stop()
and ldisc_close(), so I wanted to avoid code duplication, and relied on
ndo_stop(). Oops.



Thanks,

Max

  parent reply	other threads:[~2022-12-01 19:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  7:34 [PATCH] can: slcan: fix freed work crash Jiri Slaby (SUSE)
2022-12-01 10:13 ` Petr Vorel
2022-12-01 18:52 ` Max Staudt [this message]
2022-12-02 12:14   ` Marc Kleine-Budde
2022-12-02 15:27 ` Marc Kleine-Budde
2022-12-02 15:32   ` Max Staudt

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=20221202035242.155d54f4.max@enpas.org \
    --to=max@enpas.org \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jirislaby@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petr.vorel@suse.com \
    --cc=richard.palethorpe@suse.com \
    --cc=stable@vger.kernel.org \
    --cc=wg@grandegger.com \
    /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).