s390x/pci: fix null pointer bug
We should make sure that it's not NULL firstly. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
51009170d8
commit
7fc0abf4cb
@ -712,7 +712,7 @@ static void s390_pcihost_hot_unplug(HotplugHandler *hotplug_dev,
|
||||
pci_dev = PCI_DEVICE(dev);
|
||||
|
||||
for (i = 0 ; i < PCI_SLOT_MAX; i++) {
|
||||
if (s->pbdev[i]->pdev == pci_dev) {
|
||||
if (s->pbdev[i] && s->pbdev[i]->pdev == pci_dev) {
|
||||
pbdev = s->pbdev[i];
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user