linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] n_gsm: Fix write handling for zero bytes written
@ 2020-08-17 13:54 Tony Lindgren
  2020-08-18  8:24 ` Jiri Slaby
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2020-08-17 13:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Gregory CLEMENT, Jiri Slaby, linux-serial, linux-kernel

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.

Signed-off-by: Tony Lindgren <tony@atomide.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;
-- 
2.28.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-19  6:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 13:54 [PATCH] n_gsm: Fix write handling for zero bytes written Tony Lindgren
2020-08-18  8:24 ` Jiri Slaby
2020-08-18  9:56   ` Tony Lindgren
2020-08-18 10:14     ` Jiri Slaby
2020-08-18 10:47       ` Tony Lindgren
2020-08-19  6:19         ` Jiri Slaby
2020-08-19  6:40           ` Tony Lindgren

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).