All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jon Burgess" <Jon_Burgess@eur.3com.com>
To: Andre Hedrick <andre@linux-ide.org>
Cc: linux-kernel@vger.kernel.org
Subject: [Patch] oops with cs5530 using ide.2.2.17.all.20000904.patch  (probably 2.4 as well)
Date: Fri, 17 Nov 2000 15:10:53 +0000	[thread overview]
Message-ID: <8025699A.0053EEFF.00@notesmta.eur.3com.com> (raw)



When using Linux-2.2.17 + ide.2.2.17.all.20000904.patch on a board with the
CS5530, doing the following generates a kernel NULL dereference:

pb-3com# cat /proc/ide/cs5530
Unable to handle kernel NULL pointer dereference at virtual address 0000003c
...

This is caused because the 'bmide_dev' in cs5530.c is NULL. This has been set
wrongly because the 'dev' value used in pci_init_cs5530() is corrupted by the
loop:

     for( dev = pci_devices; dev; dev=dev->next)
     {...}

A fix is to move the setting of the 'bmide_dev' value to before this loop.

A quick look at Linux-2.4.0-test9 shows it probably suffers from the same
problem as well.

Below is a patch against Linux-2.2.17 + ide.2.2.17.all.20000904.patch

--- cs5530.c   Fri Nov 17 10:17:15 2000
+++ cs5530.c   Fri Nov 17 14:45:06 2000
@@ -268,6 +268,14 @@
     unsigned short pcicmd = 0;
     unsigned long flags;

+#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS)
+    if (!cs5530_proc) {
+         cs5530_proc = 1;
+         bmide_dev = dev;
+         cs5530_display_info = &cs5530_get_info;
+    }
+#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */
+
     for(dev = pci_devices; dev; dev=dev->next) {
          if (dev->vendor == PCI_VENDOR_ID_CYRIX) {
               switch (dev->device) {
@@ -337,14 +345,6 @@
     pci_write_config_byte(master_0, 0x43, 0xc1);

     restore_flags(flags);
-
-#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS)
-    if (!cs5530_proc) {
-         cs5530_proc = 1;
-         bmide_dev = dev;
-         cs5530_display_info = &cs5530_get_info;
-    }
-#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */

     return 0;
 }


     Jon




PLANET PROJECT will connect millions of people worldwide through the combined
technology of 3Com and the Internet. Find out more and register now at
http://www.planetproject.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

                 reply	other threads:[~2000-11-17 15:42 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=8025699A.0053EEFF.00@notesmta.eur.3com.com \
    --to=jon_burgess@eur.3com.com \
    --cc=andre@linux-ide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.