lkml.org 
[lkml]   [2005]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ide-disk oopses on boot
Hello Christoph,
back in June your '[PATCH] NUMA aware block device control structure
allocation' patch went in, changing ide-disk.c's code:

- g = alloc_disk(1 << PARTN_BITS);
+ g = alloc_disk_node(1 << PARTN_BITS,
+ pcibus_to_node(drive->hwif->pci_dev->bus));

Problem is that pci_dev may be NULL - and it is NULL for example with
kernel I've just built, with amd IDE driver built as a module while with
ide-disk built into the kernel.

I think that you probably want to guard your code by
'if (drive->hwif->pci_dev)', as besides my silly configuration mistake
also ISA devices have a chance to have pci_dev NULL. Not that there are
any such users if nobody hit it in the last 6 weeks...

I've just built amd IDE driver into the kernel, where it belongs anyway,
but just in case please apply this patch...
Thanks,
Petr Vandrovec


Signed-off-by: Petr Vandrovec <vandrove@vc.cvut.cz>

--- linux-2.6.13-rc6-00dd.dist/drivers/ide/ide-disk.c 2005-08-09 13:14:26.000000000 +0200
+++ linux-2.6.13-rc6-00dd/drivers/ide/ide-disk.c 2005-08-09 15:11:51.000000000 +0200
@@ -1219,8 +1219,12 @@
if (!idkp)
goto failed;

- g = alloc_disk_node(1 << PARTN_BITS,
- pcibus_to_node(drive->hwif->pci_dev->bus));
+ if (drive->hwif->pci_dev) {
+ g = alloc_disk_node(1 << PARTN_BITS,
+ pcibus_to_node(drive->hwif->pci_dev->bus));
+ } else {
+ g = alloc_disk(1 << PARTN_BITS);
+ }
if (!g)
goto out_free_idkp;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-09 15:30    [W:0.092 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site