From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxxkq-0001fY-Ax for qemu-devel@nongnu.org; Thu, 28 May 2015 09:21:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yxxkk-0004MK-ON for qemu-devel@nongnu.org; Thu, 28 May 2015 09:21:48 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:33305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yxxkk-0004Lf-Js for qemu-devel@nongnu.org; Thu, 28 May 2015 09:21:42 -0400 Received: by iebgx4 with SMTP id gx4so37913187ieb.0 for ; Thu, 28 May 2015 06:21:42 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1432814932-12608-30-git-send-email-zhaoshenglong@huawei.com> References: <1432814932-12608-1-git-send-email-zhaoshenglong@huawei.com> <1432814932-12608-30-git-send-email-zhaoshenglong@huawei.com> From: Peter Maydell Date: Thu, 28 May 2015 14:21:21 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 29/29] hw/s390x/sclpcpu.c: Fix memory leak spotted by valgrind List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: QEMU Trivial , Paolo Bonzini , Michael Tokarev , QEMU Developers , Shannon Zhao On 28 May 2015 at 13:08, Shannon Zhao wrote: > @@ -81,7 +81,10 @@ static void trigger_signal(void *opaque, int n, int level) > > static int irq_cpu_hotplug_init(SCLPEvent *event) > { > - irq_cpu_hotplug = qemu_allocate_irqs(trigger_signal, event, 1); > + qemu_irq irq = qemu_allocate_irq(trigger_signal, event, 0); > + > + irq_cpu_hotplug = irq; > + qemu_free_irq(irq); > return 0; Huh? Surely we can't validly use the irq once you've called qemu_free_irq() on it? -- PMM