OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e35f29d
)
pci: move dereferencing of root only after verifying valid root pointer
author
Saravanakumar
<saravanakumar.punith@gmail.com>
Thu, 22 May 2014 11:33:50 +0000
(17:03 +0530)
committer
Michael Tokarev
<mjt@tls.msk.ru>
Fri, 23 May 2014 20:10:29 +0000
(
00:10
+0400)
Signed-off-by: Saravanakumar <saravanakumar.punith@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/pci/pci.c
patch
|
blob
|
history
diff --git
a/hw/pci/pci.c
b/hw/pci/pci.c
index
22fe5ee
..
8d6a8d4
100644
(file)
--- 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);