patch-pre2.0.2 linux/drivers/cdrom/gscd.c

Next file: linux/drivers/char/keyboard.c
Previous file: linux/drivers/cdrom/cm206.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.1/linux/drivers/cdrom/gscd.c linux/drivers/cdrom/gscd.c
@@ -370,11 +370,14 @@
 	if (gscdPresent == 0)
 		return -ENXIO;			/* no hardware */
 
+	MOD_INC_USE_COUNT;
+
         get_status ();
         st = disk_state & (ST_NO_DISK | ST_DOOR_OPEN);
         if ( st )
         {
            printk ( "GSCD: no disk or door open\n" );
+           MOD_DEC_USE_COUNT;
            return -ENXIO;
         }
                    
@@ -382,8 +385,6 @@
 		return -EIO;
 */
 
-	MOD_INC_USE_COUNT;
- 
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this