Эх сурвалжийг харах

Staging: speakup: don't die if accessing sysfs without synth

Setting a 'silent' parameter without a synth would crash the kernel.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sasha Levin 11 жил өмнө
parent
commit
8b9c012a42

+ 3 - 0
drivers/staging/speakup/synth.c

@@ -212,6 +212,9 @@ void synth_start(void)
 
 
 void spk_do_flush(void)
 void spk_do_flush(void)
 {
 {
+	if (!synth)
+		return;
+
 	speakup_info.flushing = 1;
 	speakup_info.flushing = 1;
 	synth_buffer_clear();
 	synth_buffer_clear();
 	if (synth->alive) {
 	if (synth->alive) {