diff options
-rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index f184d1d2ecbe..cb7818ffd5cf 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c | |||
@@ -1075,13 +1075,12 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1075 | 1075 | ||
1076 | /* make our own copy of the pci bus structure, | 1076 | /* make our own copy of the pci bus structure, |
1077 | * as we like tweaking it a lot */ | 1077 | * as we like tweaking it a lot */ |
1078 | ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL); | 1078 | ctrl->pci_bus = kmemdup(pdev->bus, sizeof(*ctrl->pci_bus), GFP_KERNEL); |
1079 | if (!ctrl->pci_bus) { | 1079 | if (!ctrl->pci_bus) { |
1080 | err("out of memory\n"); | 1080 | err("out of memory\n"); |
1081 | rc = -ENOMEM; | 1081 | rc = -ENOMEM; |
1082 | goto err_free_ctrl; | 1082 | goto err_free_ctrl; |
1083 | } | 1083 | } |
1084 | memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus)); | ||
1085 | 1084 | ||
1086 | ctrl->bus = pdev->bus->number; | 1085 | ctrl->bus = pdev->bus->number; |
1087 | ctrl->rev = pdev->revision; | 1086 | ctrl->rev = pdev->revision; |