Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD7AAC3F2CD for ; Mon, 23 Mar 2020 14:43:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82CE82072D for ; Mon, 23 Mar 2020 14:43:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82CE82072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=eik.bme.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34727 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGOIt-0004bq-MH for qemu-devel@archiver.kernel.org; Mon, 23 Mar 2020 10:43:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42610) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGOII-0003xe-Aq for qemu-devel@nongnu.org; Mon, 23 Mar 2020 10:43:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGOIH-0000QE-9v for qemu-devel@nongnu.org; Mon, 23 Mar 2020 10:43:10 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:11137) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGOIE-0000PK-MB; Mon, 23 Mar 2020 10:43:06 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 019D574637E; Mon, 23 Mar 2020 15:43:03 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id DA6887461AE; Mon, 23 Mar 2020 15:43:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id D8DEC745953; Mon, 23 Mar 2020 15:43:02 +0100 (CET) Date: Mon, 23 Mar 2020 15:43:02 +0100 (CET) From: BALATON Zoltan To: Peter Maydell Subject: Re: Coverity CID 1421984 In-Reply-To: Message-ID: References: <88618db3-cb48-12bd-6152-b642b25a0287@redhat.com> User-Agent: Alpine 2.22 (BSF 395 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:738:2001:2001::2001 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Qemu-block , =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= , "qemu-devel@nongnu.org" , Max Reitz , qemu-ppc , John Snow , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 23 Mar 2020, Peter Maydell wrote: > On Mon, 23 Mar 2020 at 14:06, BALATON Zoltan wrote: >> On Mon, 23 Mar 2020, Peter Maydell wrote: >>> Coverity has flagged up a lot of leaks involving qemu_allocate_irqs(); >>> most of them I've for the moment just set as "insignificant, fix >>> required" because they're in called-once functions like board init. >>> If this device can't be hot-unplugged and so we will only ever call >>> realize once, it would fall in that category too. Otherwise I'd >>> suggest conversion to qdev_init_gpio_in(). (This allocates arrays >>> of IRQs under the hood too, but the device_finalize() function will >>> automatically free them for you, so it's easier to use non-leakily.) >> >> I think I can't do that in sii3112 becuase I need to pass irq to this func: >> >> void ide_init2(IDEBus *bus, qemu_irq irq); > > ide_init2(bus, qdev_get_gpio_in(DEVICE(dev), i); > > should do what you want, I think. I don't understand what you mean. Sent a patch that I think might fix this warning for now. I'd leave qdevifying ide code to someone else. Regards, BALATON Zoltan