summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2017-08-12 09:05:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-18 15:57:17 -0700
commitf5bee24d866efd73413d7b88c734a194fa46fdc5 (patch)
tree5a28ec137d064828450a2e208c7413444ff38750 /drivers/staging/greybus
parent043a2e7520f23da5487c2493acf4712cd7c1461b (diff)
staging: speakup: fix async usb removal
When an external USB synth is unplugged while the module is loaded, we get a null pointer deref. This is because the tty disappears while speakup tries to use to to communicate with the synth. This patch fixes it by checking tty for null before using it. Since tty can become null between the check and its usage, a mutex is introduced. tty usage is now surrounded by the mutex, as is the code in speakup_ldisc_close which sets the tty to null. The mutex also serialises calls to tty from speakup code. In case of tty being null, this sets synth->alive to zero and restarts ttys in case they were stopped by speakup. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
0 files changed, 0 insertions, 0 deletions