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

Jens Axboe (axboe@suse.de)
Thu, 19 Apr 2001 13:46:01 +0200


--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=cd-get-entry-1

--- 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

--dDRMvlgZJXvWKvBx-- - 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/