[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1b8538a8-d8b6-4287-36e1-aa1e0863ff2d@kernel.org>
Date: Tue, 18 Aug 2020 10:24:22 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Tony Lindgren <tony@...mide.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Gregory CLEMENT <gregory.clement@...tlin.com>,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] n_gsm: Fix write handling for zero bytes written
On 17. 08. 20, 15:54, Tony Lindgren wrote:
> If write returns zero we currently end up removing the message
> from the queue. Instead of removing the message, we want to just
> break out of the loop just like we already do for error codes.
When exactly does the only writer (gsmld_output) return zero for
non-zero len parameter?
> Signed-off-by: Tony Lindgren <tony@...mide.com>
> ---
> drivers/tty/n_gsm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -691,7 +691,8 @@ static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci)
> print_hex_dump_bytes("gsm_data_kick: ",
> DUMP_PREFIX_OFFSET,
> gsm->txframe, len);
> - if (gsm->output(gsm, gsm->txframe, len) < 0)
> +
> + if (gsm->output(gsm, gsm->txframe, len) <= 0)
> break;
> /* FIXME: Can eliminate one SOF in many more cases */
> gsm->tx_bytes -= msg->len;
>
thanks,
--
js
Powered by blists - more mailing lists