diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-12-02 13:56:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-08 19:56:05 -0500 |
commit | 82f91fe092b6eacd82e976b8955443f9fd97d07e (patch) | |
tree | 42b967f676e8054a222e58521024babe250b88c9 /drivers/tty/n_gsm.c | |
parent | 6c67716d64103e5a8e23c45dcdfc76520033d479 (diff) |
tty: Always handle NULL flag ptr
Most line disciplines already handle the undocumented NULL flag
ptr in their .receive_buf method; however, several don't.
Document the NULL flag ptr, and correct handling in the
N_MOUSE, N_GSM0710 and N_R394 line disciplines.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_gsm.c')
-rw-r--r-- | drivers/tty/n_gsm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index c0f76da55304..c09db11b8831 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c | |||
@@ -2269,14 +2269,15 @@ static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
2269 | char *f; | 2269 | char *f; |
2270 | int i; | 2270 | int i; |
2271 | char buf[64]; | 2271 | char buf[64]; |
2272 | char flags; | 2272 | char flags = TTY_NORMAL; |
2273 | 2273 | ||
2274 | if (debug & 4) | 2274 | if (debug & 4) |
2275 | print_hex_dump_bytes("gsmld_receive: ", DUMP_PREFIX_OFFSET, | 2275 | print_hex_dump_bytes("gsmld_receive: ", DUMP_PREFIX_OFFSET, |
2276 | cp, count); | 2276 | cp, count); |
2277 | 2277 | ||
2278 | for (i = count, dp = cp, f = fp; i; i--, dp++) { | 2278 | for (i = count, dp = cp, f = fp; i; i--, dp++) { |
2279 | flags = *f++; | 2279 | if (f) |
2280 | flags = *f++; | ||
2280 | switch (flags) { | 2281 | switch (flags) { |
2281 | case TTY_NORMAL: | 2282 | case TTY_NORMAL: |
2282 | gsm->receive(gsm, *dp); | 2283 | gsm->receive(gsm, *dp); |