Skip to contentSkip to conversation

backlight: Do not hang forever if helper pid is -1

PATCH In review Olivier Fourdan 2 participants 2 messages Apr 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backlight: Do not hang forever if helper pid is -1

Backlight helper PID is set to -1 by default, if for some reason it's not set, we may end up with waitpid(-1, ...) which will hang forever.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90230

---
 src/backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/backlight.c +1 -1
index 84d8f76..c65e466 100644
@@ -523,7 +523,7 @@ void backlight_disable(struct backlight *b)
 void backlight_close(struct backlight *b)
 {
 	backlight_disable(b);
-	if (b->pid)
+	if (b->pid > 0)
 		waitpid(b->pid, NULL, 0);
 }
 
Signature · 6 lines
2.3.6

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 5 lines · Olivier Fourdan

Backlight helper PID is set to -1 by default, if for some reason it's not set, we may end up with waitpid(-1, ...) which will hang forever.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90230

Nice catch. Pushed with thanks,
1a67dac..e7016d3 master -> master
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx