aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serport.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-12-02 13:56:03 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 19:56:05 -0500
commit82f91fe092b6eacd82e976b8955443f9fd97d07e (patch)
tree42b967f676e8054a222e58521024babe250b88c9 /drivers/input/serio/serport.c
parent6c67716d64103e5a8e23c45dcdfc76520033d479 (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/input/serio/serport.c')
-rw-r--r--drivers/input/serio/serport.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
index 8755f5f3ad37..0cb7ef59071b 100644
--- a/drivers/input/serio/serport.c
+++ b/drivers/input/serio/serport.c
@@ -124,7 +124,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
124{ 124{
125 struct serport *serport = (struct serport*) tty->disc_data; 125 struct serport *serport = (struct serport*) tty->disc_data;
126 unsigned long flags; 126 unsigned long flags;
127 unsigned int ch_flags; 127 unsigned int ch_flags = 0;
128 int i; 128 int i;
129 129
130 spin_lock_irqsave(&serport->lock, flags); 130 spin_lock_irqsave(&serport->lock, flags);
@@ -133,18 +133,20 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
133 goto out; 133 goto out;
134 134
135 for (i = 0; i < count; i++) { 135 for (i = 0; i < count; i++) {
136 switch (fp[i]) { 136 if (fp) {
137 case TTY_FRAME: 137 switch (fp[i]) {
138 ch_flags = SERIO_FRAME; 138 case TTY_FRAME:
139 break; 139 ch_flags = SERIO_FRAME;
140 140 break;
141 case TTY_PARITY: 141
142 ch_flags = SERIO_PARITY; 142 case TTY_PARITY:
143 break; 143 ch_flags = SERIO_PARITY;
144 144 break;
145 default: 145
146 ch_flags = 0; 146 default:
147 break; 147 ch_flags = 0;
148 break;
149 }
148 } 150 }
149 151
150 serio_interrupt(serport->serio, cp[i], ch_flags); 152 serio_interrupt(serport->serio, cp[i], ch_flags);