|
From: | Cao jin |
Subject: | Re: [Qemu-devel] [PATCH v3 4/4] Xen PCI passthru: convert to realize() |
Date: | Thu, 7 Jan 2016 15:16:06 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 01/07/2016 12:07 AM, Eric Blake wrote:
On 01/05/2016 07:39 PM, Cao jin wrote:
[...]
@@ -827,27 +827,26 @@ static int xen_pt_initfn(PCIDevice *d) xen_pt_config_init(s, &local_err); if (local_err) { error_append_hint(&local_err, "PCI Config space initialisation failed"); - rc = -1; + error_propagate(errp, local_err); goto err_out; }Looks like this fixes a memory leak in an earlier patch; maybe you need to shuffle hunks around?
Sorry, don`t quite undertand what "shuffle hunks around" means, could you detail it?
[...]
err_out: + for (i = 0; i < PCI_ROM_SLOT; i++) { + object_unparent(OBJECT(&s->bar[i])); + } + object_unparent(OBJECT(&s->rom)); + xen_pt_destroy(d); assert(rc); - return rc;Is the assertion still needed?
Actually I think in the original code, the assertion isn`t necessary too, but I guess it is a kind of defensive coding? You can see, not very if (rc) equals TRUE will goto err_out. So I prefer not to touch it when I am not sure about the author`s intent.
-- Yours Sincerely, Cao jin
[Prev in Thread] | Current Thread | [Next in Thread] |