Re: Problems with Toshiba SD-W2002 DVD-RAM drive (IDE)

Jens Axboe
2001-04-19T11:46:32Z

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

On Thu, Apr 19 2001, Stefan Jaschke wrote:
> Hi Jens,
>
> I applied your patch to 2.4.4-pre4. It compiled fine, but crashed during
> boot (just right after the IDE init) with
> -------------------
> Uniform CD-ROM driver Revision: 3.12
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> printing eip: ...
> Oops: 0000
> ...
> -------------------

This should fix it.

--
Jens Axboe

[-- Attachment #2: cd-get-entry-1 --]
[-- Type: text/plain, Size: 743 bytes --]

--- drivers/cdrom/cdrom.c~ Thu Apr 19 13:44:46 2001
+++ drivers/cdrom/cdrom.c Thu Apr 19 13:45:33 2001
@@ -350,6 +350,12 @@
{
int i, nr, foo;

+ if (!cdrom_numbers) {
+ int n_entries = CDROM_MAX_CDROMS / (sizeof(unsigned long) * 8);
+ cdrom_numbers = kmalloc(n_entries * sizeof(unsigned long), GFP_KERNEL);
+ memset(cdrom_numbers, 0, n_entries * sizeof(unsigned long));
+ }
+
nr = 0;
foo = -1;
for (i = 0; i < CDROM_MAX_CDROMS / (sizeof(unsigned long) * 8); i++) {
@@ -2696,10 +2702,6 @@

static int __init cdrom_init(void)
{
- int n_entries = CDROM_MAX_CDROMS / (sizeof(unsigned long) * 8);
-
- cdrom_numbers = kmalloc(n_entries * sizeof(unsigned long), GFP_KERNEL);
-
#ifdef CONFIG_SYSCTL
cdrom_sysctl_register();
#endif