Printer Bug

From: Stephen Marz (smarz@mail.tds.net)
Date: Wed Feb 23 2000 - 10:40:18 EST


For kernel: linux-2.3.47
lp.c is located in "/usr/src/linux"/drivers/char/
Bug is mostly cosmetic but can break some things.

A bug in lp.c was causing the devfs's device (printers/0) to be put into
root. Whenever lp.o was loaded as a module or compiled into the kernel,
0 would show up in the root.

A simple fix is the included patch or just simply moving the function
devfs_mk_dir above parport_register_driver. Parport_register_driver
somewhere calls devfs_register without devfs_handle being initialized to
the new directory, thus putting 0 into the root of /dev.

Thanks,

Stephen Marz


*** lp.c Thu Feb 17 18:24:52 2000
--- lp-new.c Wed Feb 23 09:23:04 2000
***************
*** 783,794 ****
                  return -EIO;
          }
  
          if (parport_register_driver (&lp_driver)) {
                  printk ("lp: unable to register with parport\n");
                  return -EIO;
          }
-
- devfs_handle = devfs_mk_dir (NULL, "printers", 0, NULL);
  
          if (!lp_count) {
                  printk (KERN_INFO "lp: driver loaded but no devices found\n");
--- 783,794 ----
                  return -EIO;
          }
  
+ devfs_handle = devfs_mk_dir (NULL, "printers", 0, NULL);
+
          if (parport_register_driver (&lp_driver)) {
                  printk ("lp: unable to register with parport\n");
                  return -EIO;
          }
  
          if (!lp_count) {
                  printk (KERN_INFO "lp: driver loaded but no devices found\n");

-
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 : Wed Feb 23 2000 - 21:00:34 EST