linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: speakup: don't die if accessing sysfs without synth
@ 2014-05-27 23:08 Sasha Levin
  2014-05-28  6:49 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2014-05-27 23:08 UTC (permalink / raw)
  To: w.d.hubbs, chris, kirk, samuel.thibault, gregkh
  Cc: speakup, devel, linux-kernel, Sasha Levin

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

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/staging/speakup/synth.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 0b3549b..172cf62 100644
--- a/drivers/staging/speakup/synth.c
+++ b/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) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-28  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 23:08 [PATCH] Staging: speakup: don't die if accessing sysfs without synth Sasha Levin
2014-05-28  6:49 ` Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).