From patchwork Thu Jan 22 00:26:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 19741 X-Patchwork-Delegate: jk@ozlabs.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 3C1F0DDF8C for ; Thu, 22 Jan 2009 14:31:58 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org X-Greylist: delayed 1307 seconds by postgrey-1.31 at ozlabs; Thu, 22 Jan 2009 14:31:51 EST Received: from hera.kernel.org (hera.kernel.org [140.211.167.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C16C8DDF51; Thu, 22 Jan 2009 14:31:51 +1100 (EST) Received: from hera.kernel.org (IDENT:U2FsdGVkX1+H5O2rGCiW11prAgN0ZkRfmdkR3nXsfeI@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n0M39xwI002836 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Jan 2009 03:09:59 GMT Received: (from geoff@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n0M39wR0002835; Thu, 22 Jan 2009 03:09:58 GMT Message-Id: <20090122002653.318873144@am.sony.com> References: <20090122002653.146035454@am.sony.com> User-Agent: quilt/0.46-1 Date: Wed, 21 Jan 2009 16:26:55 -0800 From: Geoff Levand To: Jeremy Kerr Content-Disposition: inline; filename=fix-waiter-alloc.diff X-Virus-Scanned: ClamAV 0.93.3/8886/Wed Jan 21 22:46:06 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Thu, 22 Jan 2009 03:10:00 +0000 (UTC) Cc: cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [patch 2/9] petitboot: Fix waiter alloc X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Add the missing assignment of the global n_pollfds variable. Fix a minor memory leak in waiter_poll(). Signed-off-by: Geoff Levand --- lib/waiter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/lib/waiter.c +++ b/lib/waiter.c @@ -54,9 +54,10 @@ int waiter_poll(void) static int n_pollfds; int i, rc; - if (n_waiters > n_pollfds) { + if (n_waiters != n_pollfds) { pollfds = talloc_realloc(NULL, pollfds, struct pollfd, n_waiters); + n_pollfds = n_waiters; } for (i = 0; i < n_waiters; i++) {