From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Andre Hedrick <andre@linux-ide.org>,
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
Chris Ross <lak1646@tebibyte.org>
Cc: Alan Cox <alan@redhat.com>, linux-kernel@vger.kernel.org
Subject: [2.4 PATCH] Don't panic on IDE DMA errors
Date: Mon, 28 Nov 2005 10:22:39 -0200 [thread overview]
Message-ID: <20051128122239.GB24608@logos.cnet> (raw)
diff-tree e8f3e8dd41308fb66c026f51bb86b23205ad48c1 (from 0b85d6aa75faefe28d90362424035ef7b349974c)
Author: Chris Ross <lak1646@tebibyte.org>
Date: Wed Nov 23 15:56:00 2005 +0000
[PATCH] Don't panic on IDE DMA errors
Kernel 2.4.32 and earlier can panic when trying to read a corrupted
sector from an IDE disk.
The function ide_dma_timeout_retry can end a request early by calling
idedisk_error, but then goes on to use the request anyway causing a
kernel panic due to a null pointer exception. This patch fixes that.
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 3f6a0aa..6fc6f77 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -899,11 +899,13 @@ static ide_startstop_t ide_dma_timeout_r
rq = HWGROUP(drive)->rq;
HWGROUP(drive)->rq = NULL;
- rq->errors = 0;
- rq->sector = rq->bh->b_rsector;
- rq->current_nr_sectors = rq->bh->b_size >> 9;
- rq->hard_cur_sectors = rq->current_nr_sectors;
- rq->buffer = rq->bh->b_data;
+ if (rq) {
+ rq->errors = 0;
+ rq->sector = rq->bh->b_rsector;
+ rq->current_nr_sectors = rq->bh->b_size >> 9;
+ rq->hard_cur_sectors = rq->current_nr_sectors;
+ rq->buffer = rq->bh->b_data;
+ }
return ret;
}
next reply other threads:[~2005-11-28 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-28 12:22 Marcelo Tosatti [this message]
2005-12-31 10:01 ` Andre Hedrick
2006-01-01 11:00 ` Chris Ross
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=20051128122239.GB24608@logos.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=alan@redhat.com \
--cc=andre@linux-ide.org \
--cc=lak1646@tebibyte.org \
--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
all inboxes | Powered by JetHome®