public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] oops with cs5530 using ide.2.2.17.all.20000904.patch  (probably 2.4 as well)
@ 2000-11-17 15:10 Jon Burgess
  0 siblings, 0 replies; only message in thread
From: Jon Burgess @ 2000-11-17 15:10 UTC (permalink / raw)
  To: Andre Hedrick; +Cc: linux-kernel



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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-11-17 15:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-17 15:10 [Patch] oops with cs5530 using ide.2.2.17.all.20000904.patch (probably 2.4 as well) Jon Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox