From patchwork Sat Jan 22 09:29:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 79999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EC300B7109 for ; Sat, 22 Jan 2011 23:31:27 +1100 (EST) Received: from localhost ([127.0.0.1]:48614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pgccl-0004SG-MG for incoming@patchwork.ozlabs.org; Sat, 22 Jan 2011 07:31:23 -0500 Received: from [140.186.70.92] (port=46186 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pgcba-0003fo-2S for qemu-devel@nongnu.org; Sat, 22 Jan 2011 07:30:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgcbY-0006Sb-Rp for qemu-devel@nongnu.org; Sat, 22 Jan 2011 07:30:09 -0500 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:58725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgcbY-0006SU-JV for qemu-devel@nongnu.org; Sat, 22 Jan 2011 07:30:08 -0500 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0M9TrlY006200 for ; Sat, 22 Jan 2011 09:29:53 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0M9Ttub1536078 for ; Sat, 22 Jan 2011 09:29:55 GMT Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0M9TquT028150 for ; Sat, 22 Jan 2011 02:29:52 -0700 Received: from stefanha-thinkpad.ibm.com (gbv82324-009146172195.uk.ibm.com [9.146.172.195]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0M9TlNX028082; Sat, 22 Jan 2011 02:29:52 -0700 From: Stefan Hajnoczi To: Date: Sat, 22 Jan 2011 09:29:18 +0000 Message-Id: <1295688567-25496-4-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1295688567-25496-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1295688567-25496-1-git-send-email-stefanha@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi Subject: [Qemu-devel] [RFC][PATCH 03/12] Make sure to release allocated stack when coroutine is released. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Copied from a fix to the original code by Anthony Liguori . Signed-off-by: Stefan Hajnoczi --- coroutine_ucontext.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/coroutine_ucontext.c b/coroutine_ucontext.c index 25e8687..f76da94 100644 --- a/coroutine_ucontext.c +++ b/coroutine_ucontext.c @@ -38,6 +38,7 @@ static int _coroutine_release(struct continuation *cc) if (ret < 0) return ret; } + munmap(co->cc.stack, co->cc.stack_size); co->caller = NULL;