From patchwork Wed Apr 29 09:19:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Fourdan X-Patchwork-Id: 6294271 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 64FAB9F1C2 for ; Wed, 29 Apr 2015 09:20:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9746620306 for ; Wed, 29 Apr 2015 09:20:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C096A20254 for ; Wed, 29 Apr 2015 09:20:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44BCF6E130; Wed, 29 Apr 2015 02:20:06 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id AA4F56E130 for ; Wed, 29 Apr 2015 02:20:04 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 50568B5C06 for ; Wed, 29 Apr 2015 09:20:04 +0000 (UTC) Received: from t440s.redhat.com (vpn1-6-221.ams2.redhat.com [10.36.6.221]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3T9K2No008217; Wed, 29 Apr 2015 05:20:03 -0400 From: Olivier Fourdan To: intel-gfx@lists.freedesktop.org Date: Wed, 29 Apr 2015 11:19:47 +0200 Message-Id: <1430299187-21049-1-git-send-email-ofourdan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Subject: [Intel-gfx] [PATCH] backlight: Do not hang forever if helper pid is -1 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- src/backlight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backlight.c b/src/backlight.c index 84d8f76..c65e466 100644 --- a/src/backlight.c +++ b/src/backlight.c @@ -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); }