public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdlab.org>
To: linux-kernel@vger.kernel.org, Alan <alan@lxorguk.ukuu.org.uk>,
	Linus <torvalds@transmeta.com>,
	nils@kernelconcepts.de
Subject: [patch] i810-tco OOPS
Date: Wed, 11 Jul 2001 12:33:16 -0700	[thread overview]
Message-ID: <3B4CA9FC.92AE39BC@osdlab.org> (raw)

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

Please apply to 2.4.7-preX and to 2.4.6-acX.

If one builds a kernel with the i810 tco watchdog driver
but does not have this chipset, the i810tco_getdevice()
function doesn't detect this and still calls pci_read_config_byte(),
which promptly oopses...since the pci_for_each_dev() loop
termination wasn't checked  [i.e., <dev> is non-null after the
loop whether the device was found or not].

-- 
~Randy

[-- Attachment #2: i810found.diff --]
[-- Type: text/plain, Size: 477 bytes --]

--- linux/drivers/char/i810-tco.c.org	Mon Jul  2 13:56:41 2001
+++ linux/drivers/char/i810-tco.c	Wed Jul 11 12:11:22 2001
@@ -256,14 +256,19 @@
 	struct pci_dev *dev;
 	u8 val1, val2;
 	u16 badr;
+	int found = 0;
 	/*
 	 *      Find the PCI device
 	 */
 
 	pci_for_each_dev(dev) {
-		if (pci_match_device(i810tco_pci_tbl, dev))
+		if (pci_match_device(i810tco_pci_tbl, dev)) {
+			found = 1;
 			break;
+		}
 	}
+	if (!found)
+		return 0;
 
 	if ((i810tco_pci = dev)) {
 		/*

                 reply	other threads:[~2001-07-11 19:34 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=3B4CA9FC.92AE39BC@osdlab.org \
    --to=rddunlap@osdlab.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nils@kernelconcepts.de \
    --cc=torvalds@transmeta.com \
    /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