[patch 26/27] PCI hotplug: cpqphp: fix kernel NULL pointer dereference

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Thursday, October 23, 2008 - 9:35 pm

2.6.27-stable review patch.  If anyone has any objections, please let us 
know.

------------------
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

commit d2174c3c07adad88dd9ba37a731e0b00b746822a upstream

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.

Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/hotplug/cpqphp_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -435,7 +435,7 @@ static int ctrl_slot_setup(struct contro
 				slot->number, ctrl->slot_device_offset,
 				slot_number);
 		result = pci_hp_register(hotplug_slot,
-					 ctrl->pci_dev->subordinate,
+					 ctrl->pci_dev->bus,
 					 slot->device);
 		if (result) {
 			err("pci_hp_register failed with error %d\n", result);

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/27] 2.6.27.4-stable review, Greg KH, (Thu Oct 23, 9:33 pm)
[patch 02/27] edac cell: fix incorrect edac_mode, Greg KH, (Thu Oct 23, 9:33 pm)
[patch 04/27] sched: fix the wrong mask_len, Greg KH, (Thu Oct 23, 9:33 pm)
[patch 07/27] USB: fix memory leak in cdc-acm, Greg KH, (Thu Oct 23, 9:33 pm)
[patch 09/27] dm kcopyd: avoid queue shuffle, Greg KH, (Thu Oct 23, 9:34 pm)
[patch 10/27] dm snapshot: fix primary_pe race, Greg KH, (Thu Oct 23, 9:34 pm)
[patch 26/27] PCI hotplug: cpqphp: fix kernel NULL pointer ..., Greg KH, (Thu Oct 23, 9:35 pm)
Re: [patch 00/27] 2.6.27.4-stable review, Greg KH, (Thu Oct 23, 10:41 pm)
Re: [patch 11/27] dm exception store: refactor zero_area, Mikulas Patocka, (Fri Oct 24, 6:40 pm)