From: Woody Suwalski The current implementation of the hpt37x_clocking() does not quarantee to always return a valid result. On one of my machines it was failing and the result return code was NULL. That was later producing segfault in pci_bus_clock_list(). A tested working workaround: if hpt37x_clocking() returns NULL, assume the slowest settings (33MHz). No segfault. Signed-off-by: Woody Suwalski Cc: Bartlomiej Zolnierkiewicz Cc: Alan Cox Signed-off-by: Andrew Morton --- drivers/ide/pci/hpt366.c | 10 ++++++++++ 1 files changed, 10 insertions(+) diff -puN drivers/ide/pci/hpt366.c~hpt366-fix-segfault-during-init drivers/ide/pci/hpt366.c --- devel/drivers/ide/pci/hpt366.c~hpt366-fix-segfault-during-init 2006-04-01 16:28:48.000000000 -0800 +++ devel-akpm/drivers/ide/pci/hpt366.c 2006-04-01 16:29:48.000000000 -0800 @@ -680,6 +680,11 @@ static int hpt370_tune_chipset(ide_drive list_conf = pci_bus_clock_list(speed, info->speed); pci_read_config_dword(dev, drive_pci, &drive_conf); + + /* woody@xandros.com: if we have a NULL table, assume the slowest */ + if (!info->speed) + info->speed = thirty_three_base_hpt370a; + list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); if (speed < XFER_MW_DMA_0) @@ -708,7 +713,12 @@ static int hpt372_tune_chipset(ide_drive drive_fast &= ~0x07; pci_write_config_byte(dev, regfast, drive_fast); + /* woody@xandros.com: if we have a NULL table, assume the slowest */ + if (!info->speed) + info->speed = thirty_three_base_hpt372; + list_conf = pci_bus_clock_list(speed, info->speed); + pci_read_config_dword(dev, drive_pci, &drive_conf); list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); if (speed < XFER_MW_DMA_0) _