Commit 1a76dcea authored by Bjorn Helgaas's avatar Bjorn Helgaas

Merge branch 'pci/hotplug'

- Remove unneeded break in ibmphp (Bjorn Helgaas)

- Fix pci_slot_release() NULL pointer dereference (Jubin Zhong)

* pci/hotplug:
  PCI: Fix pci_slot_release() NULL pointer dereference
  PCI: ibmphp: Remove unneeded break
parents 6a94785f 4684709b
...@@ -294,7 +294,6 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) ...@@ -294,7 +294,6 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
default: default:
err("MAJOR PROBLEM!!!!, header type not supported? %x\n", hdr_type); err("MAJOR PROBLEM!!!!, header type not supported? %x\n", hdr_type);
return -ENXIO; return -ENXIO;
break;
} /* end of switch */ } /* end of switch */
} /* end of valid device */ } /* end of valid device */
} /* end of for */ } /* end of for */
...@@ -1509,7 +1508,6 @@ static int unconfigure_boot_card(struct slot *slot_cur) ...@@ -1509,7 +1508,6 @@ static int unconfigure_boot_card(struct slot *slot_cur)
default: default:
err("MAJOR PROBLEM!!!! Cannot read device's header\n"); err("MAJOR PROBLEM!!!! Cannot read device's header\n");
return -1; return -1;
break;
} /* end of switch */ } /* end of switch */
} /* end of valid device */ } /* end of valid device */
} /* end of for */ } /* end of for */
......
...@@ -272,6 +272,9 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, ...@@ -272,6 +272,9 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
goto err; goto err;
} }
INIT_LIST_HEAD(&slot->list);
list_add(&slot->list, &parent->slots);
err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL, err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL,
"%s", slot_name); "%s", slot_name);
if (err) { if (err) {
...@@ -279,9 +282,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, ...@@ -279,9 +282,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
goto err; goto err;
} }
INIT_LIST_HEAD(&slot->list);
list_add(&slot->list, &parent->slots);
down_read(&pci_bus_sem); down_read(&pci_bus_sem);
list_for_each_entry(dev, &parent->devices, bus_list) list_for_each_entry(dev, &parent->devices, bus_list)
if (PCI_SLOT(dev->devfn) == slot_nr) if (PCI_SLOT(dev->devfn) == slot_nr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment