staging: speakup: fix tty-operation NULL derefs
authorJohan Hovold <johan@kernel.org>
Wed, 30 Jan 2019 09:49:34 +0000 (10:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2019 10:54:01 +0000 (11:54 +0100)
commita1960e0f1639cb1f7a3d94521760fc73091f6640
tree26e0580dd080143c2752ec4bf5aadd22173c0cf2
parent4d95987a32db53f3beca76f8c4c8309ef6a5f192
staging: speakup: fix tty-operation NULL derefs

The send_xchar() and tiocmset() tty operations are optional. Add the
missing sanity checks to prevent user-space triggerable NULL-pointer
dereferences.

Fixes: 6b9ad1c742bf ("staging: speakup: add send_xchar, tiocmset and input functionality for tty")
Cc: stable <stable@vger.kernel.org> # 4.13
Cc: Okash Khawaja <okash.khawaja@gmail.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/spk_ttyio.c