qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH] pci: move dereferencing of root only after ve


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [PATCH] pci: move dereferencing of root only after verifying valid root pointer.
Date: Thu, 22 May 2014 14:47:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 22/05/2014 13:33, Saravanakumar ha scritto:
Move dereferencing of root only after verifying valid root pointer.


Signed-off-by: Saravanakumar <address@hidden>
---
 hw/pci/pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 22fe5ee..8d6a8d4 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -605,13 +605,13 @@ PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, 
const char *devaddr)
     int dom, bus;
     unsigned slot;

-    assert(!root->parent_dev);
-
     if (!root) {
         fprintf(stderr, "No primary PCI bus\n");
         return NULL;
     }

+    assert(!root->parent_dev);
+
     if (!devaddr) {
         *devfnp = -1;
         return pci_find_bus_nr(root, 0);


Reviewed-by: Paolo Bonzini <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]