From: Kenji Kaneshige Date: Fri, 17 Oct 2008 00:23:51 +0000 (+0900) Subject: PCI hotplug: cpqphp: fix kernel NULL pointer dereference X-Git-Tag: v2.6.28-rc1~2^2~6 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d2174c3c07adad88dd9ba37a731e0b00b746822a;p=linux-2.6-omap-h63xx.git PCI hotplug: cpqphp: fix kernel NULL pointer dereference The following patch fixes the regression in 2.6.27 that causes kernel NULL pointer dereference at cpqphp driver probe time. This patch should be backported to the .27 stable series. Seems to have been introduced by f46753c5e354b857b20ab8e0fe7b2579831dc369. The root cause of this problem seems that cpqphp driver calls pci_hp_register() wrongly. In current implementation, cpqphp driver passes 'ctrl->pci_dev->subordinate' as a second parameter for pci_hp_register(). But because hotplug slots and it's hotplug controller (exists as a pci funcion) are on the same bus, it should be 'ctrl->pci_dev->bus' instead. Cc: Tested-by: Ingo Molnar Signed-off-by: Kenji Kaneshige Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 724d42c4adb..8514c3a1746 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -433,7 +433,7 @@ static int ctrl_slot_setup(struct controller *ctrl, slot->number, ctrl->slot_device_offset, slot_number); result = pci_hp_register(hotplug_slot, - ctrl->pci_dev->subordinate, + ctrl->pci_dev->bus, slot->device, name); if (result) {