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
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
This commit is contained in:
Olivier Fourdan 2015-04-29 10:33:19 +01:00 committed by Chris Wilson
parent 1a67dacd75
commit e7016d30f3
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}