提交 9136c683 编写于 作者: T Tony Lindgren 提交者: Greg Kroah-Hartman

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: NTony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210930060624.46523-1-tony@atomide.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 46292622
......@@ -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);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册