summaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_gsm.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2021-09-30 08:06:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-05 14:05:59 +0200
commit9136c68346d096697935b9840782f7051d5796c5 (patch)
tree943ad353ec9a40b0915ef59282168e71c29228c0 /drivers/tty/n_gsm.c
parenttty: n_gsm: clean up indenting in gsm_queue() (diff)
downloadlinux-9136c68346d096697935b9840782f7051d5796c5.tar.xz
linux-9136c68346d096697935b9840782f7051d5796c5.zip
tty: n_gsm: Don't ignore write return value in gsmld_output()
We currently have gsmld_output() ignore the return value from device write. This means we will lose packets if device write returns 0 or an error. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210930060624.46523-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/tty/n_gsm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 182d5914dfb9..0b96b14bbfe1 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -695,7 +695,7 @@ 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 (gsmld_output(gsm, gsm->txframe, len) < 0)
+ if (gsmld_output(gsm, gsm->txframe, len) <= 0)
break;
/* FIXME: Can eliminate one SOF in many more cases */
gsm->tx_bytes -= msg->len;
@@ -2415,8 +2415,7 @@ static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len)
if (debug & 4)
print_hex_dump_bytes("gsmld_output: ", DUMP_PREFIX_OFFSET,
data, len);
- gsm->tty->ops->write(gsm->tty, data, len);
- return len;
+ return gsm->tty->ops->write(gsm->tty, data, len);
}
/**