linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Adam J. Richter" <adam@yggdrasil.com>
To: alan@lxorguk.ukuu.org.uk, andre@linux-ide.org, axboe@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: Patch?: linux-2.5.42/drivers/ide/ide-probe.c null pointer dereference
Date: Sun, 13 Oct 2002 10:11:03 -0700	[thread overview]
Message-ID: <20021013101103.A1304@baldur.yggdrasil.com> (raw)

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


	Linux-2.5.42 introduced a new IDE driver function
HWIF(drive)->ide_dma_queued_on().  It appears that if the device does
not do DMA at all, ide_dma_queued_on will be set to NULL.  I guess that
is intentional, as that other code in drivers/ide actually checks
for the possibility that ide_dma_queue_on may be null.

	Anyhow, when I booted 2.5.42, I got a null pointer dereference,
and I think it was because the system that I booted had an ATAPI CDROM
drive and I think my chip set and drive combination does not do DMA for
ATAPI devices.

	Anyhow, the following patch made the problem go away, although
I'm not that confident of the correctness of the fix.  For what it's worth,
I am composing this email on the system running the changed code.

-- 
Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

[-- Attachment #2: ide-probe.diff --]
[-- Type: text/plain, Size: 373 bytes --]

--- linux-2.5.42/drivers/ide/ide-probe.c	2002-10-11 21:22:09.000000000 -0700
+++ linux/drivers/ide/ide-probe.c	2002-10-13 09:57:02.000000000 -0700
@@ -806,7 +806,8 @@
 	ide_toggle_bounce(drive, 1);
 
 #ifdef CONFIG_BLK_DEV_IDE_TCQ_DEFAULT
-	HWIF(drive)->ide_dma_queued_on(drive);
+	if (HWIF(drive)->ide_dma_queued_on)
+		HWIF(drive)->ide_dma_queued_on(drive);
 #endif
 }
 

                 reply	other threads:[~2002-10-13 17:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021013101103.A1304@baldur.yggdrasil.com \
    --to=adam@yggdrasil.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andre@linux-ide.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).