qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Xu" <peterx@redhat.com>,
	"Marcel Apfelbaum" <marcel@redhat.com>
Subject: [Qemu-devel] [PULL 2/9] pci: Initialize pci_dev->name before use
Date: Thu, 16 Nov 2017 18:40:28 +0200	[thread overview]
Message-ID: <1510850407-17266-3-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1510850407-17266-1-git-send-email-mst@redhat.com>

From: Alexey Kardashevskiy <aik@ozlabs.ru>

This moves pci_dev->name initialization earlier so
pci_dev->bus_master_as could get a name instead of an empty string.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 5ed3c8d..b2d139b 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1030,6 +1030,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
 
     pci_dev->devfn = devfn;
     pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
+    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
 
     memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
                        "bus master container", UINT64_MAX);
@@ -1039,7 +1040,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     if (qdev_hotplug) {
         pci_init_bus_master(pci_dev);
     }
-    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
     pci_dev->irq_state = 0;
     pci_config_alloc(pci_dev);
 
-- 
MST

  parent reply	other threads:[~2017-11-16 16:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 16:40 [Qemu-devel] [PULL 0/9] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
2017-11-16 16:40 ` [Qemu-devel] [PULL 1/9] fix: unrealize virtio device if we fail to hotplug it Michael S. Tsirkin
2017-11-16 16:40 ` Michael S. Tsirkin [this message]
2017-11-16 16:40 ` [Qemu-devel] [PULL 3/9] hw/pci-host: Fix x86 Host Bridges 64bit PCI hole Michael S. Tsirkin
2017-11-16 16:40 ` [Qemu-devel] [PULL 4/9] hw/pcie-pci-bridge: restrict to X86 and ARM Michael S. Tsirkin
2017-11-16 16:40 ` [Qemu-devel] [PULL 5/9] tests/acpi-test-data: update _CRS in DSDT Michael S. Tsirkin
2017-11-16 16:40 ` [Qemu-devel] [PULL 6/9] NUMA: Enable adding NUMA node implicitly Michael S. Tsirkin
2017-11-16 16:50   ` Thadeu Lima de Souza Cascardo
2017-11-16 16:41 ` [Qemu-devel] [PULL 7/9] vmcoreinfo: put it in the 'misc' device category Michael S. Tsirkin
2017-11-16 16:41 ` [Qemu-devel] [PULL 8/9] build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets Michael S. Tsirkin
2017-11-16 16:41 ` [Qemu-devel] [PULL 9/9] tests/bios-tables-test: Fix endianess problems when passing data to iasl Michael S. Tsirkin
2017-11-17  9:24 ` [Qemu-devel] [PULL 0/9] pc, pci, virtio: fixes for rc1 Peter Maydell

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=1510850407-17266-3-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=f4bug@amsat.org \
    --cc=marcel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).