Skip to contentSkip to conversation

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

PATCH In review Sasha Levin 2 participants 2 messages May 27, 2014 – May 28, 2014 Staging

lore
Share & tools
lore
#0 lore raw

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

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

---
 drivers/staging/speakup/synth.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/staging/speakup/synth.c +3 -0
index 0b3549b..172cf62 100644
@@ -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) {
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Sasha Levin, le Tue 27 May 2014 19:08:36 -0400, a écrit :

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

Quoted 21 lines
---
 drivers/staging/speakup/synth.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/staging/speakup/synth.c +3 -0
index 0b3549b..172cf62 100644
@@ -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) {
Signature · 1 line
1.7.10.4
Signature · 6 lines
Samuel
Now I know someone out there is going to claim, "Well then, UNIX is intuitive,
because you only need to learn 5000 commands, and then everything else follows
from that! Har har har!"
(Andy Bates in comp.os.linux.misc, on "intuitive interfaces", slightly
defending Macs.)