From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] pci: memory leak of PCIDevice::rom_file
Date: Mon, 24 Jan 2011 15:39:58 +0200 [thread overview]
Message-ID: <20110124133958.GB3165@redhat.com> (raw)
In-Reply-To: <f636ee3914560329d083961f6bed2acbdad206b9.1295863207.git.yamahata@valinux.co.jp>
On Mon, Jan 24, 2011 at 07:00:47PM +0900, Isaku Yamahata wrote:
> PCIDevice::rom_file is leaked.
> PCIDevice::rom_file is allocated in pci_qdev_init(), but not freed anywhere.
> free it in qemu_unregister_device().
>
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Applied, thanks.
> ---
> hw/pci.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/hw/pci.c b/hw/pci.c
> index b8f5385..044c4bd 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -833,6 +833,7 @@ static int pci_unregister_device(DeviceState *dev)
>
> pci_unregister_io_regions(pci_dev);
> pci_del_option_rom(pci_dev);
> + qemu_free(pci_dev->romfile);
> do_pci_unregister_device(pci_dev);
> return 0;
> }
> --
> 1.7.1.1
prev parent reply other threads:[~2011-01-24 13:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 10:00 [Qemu-devel] [PATCH] pci: memory leak of PCIDevice::rom_file Isaku Yamahata
2011-01-24 13:39 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110124133958.GB3165@redhat.com \
--to=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yamahata@valinux.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).