[patch] 2.4.0-test4: parport fix

From: Tim Waugh (twaugh@redhat.com)
Date: Fri Jul 14 2000 - 05:47:55 EST


Here is the fix. I already sent it to Linus.

Tim.
*/

--- linux/drivers/parport/share.c.orig Fri Jul 14 11:39:22 2000
+++ linux/drivers/parport/share.c Fri Jul 14 11:44:28 2000
@@ -122,7 +122,7 @@
 
         spin_lock (&driverlist_lock);
         for (i = 0, drv = driver_chain; drv && i < count; drv = drv->next)
- attach[i] = drv->attach;
+ attach[i++] = drv->attach;
         spin_unlock (&driverlist_lock);
 
         for (count = 0; count < i; count++)
@@ -181,6 +181,9 @@
         struct parport **ports;
         int count = 0, i;
 
+ if (!portlist)
+ get_lowlevel_driver ();
+
         /* We have to take the portlist lock for this to be sure
          * that port is valid for the duration of the callback. */
 
@@ -201,7 +204,7 @@
                 spin_lock (&parportlist_lock);
                 for (i = 0, port = portlist; port && i < count;
                      port = port->next)
- ports[i] = port;
+ ports[i++] = port;
                 spin_unlock (&parportlist_lock);
 
                 for (count = 0; count < i; count++)
@@ -209,9 +212,6 @@
 
                 kfree (ports);
         }
-
- if (!portlist)
- get_lowlevel_driver ();
 
         spin_lock (&driverlist_lock);
         drv->next = driver_chain;

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



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:19 EST