瀏覽代碼

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 年之前
父節點
當前提交
8b9c012a42
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/staging/speakup/synth.c

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

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