patch-2.4.19 linux-2.4.19/drivers/isdn/isdn_common.c

Next file: linux-2.4.19/drivers/isdn/isdn_ppp.c
Previous file: linux-2.4.19/drivers/isdn/hisax/w6692.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/isdn/isdn_common.c linux-2.4.19/drivers/isdn/isdn_common.c
@@ -75,9 +75,11 @@
 isdn_lock_drivers(void)
 {
 	int i;
+	isdn_ctrl cmd;
 
-	for (i = 0; i < dev->drivers; i++) {
-		isdn_ctrl cmd;
+	for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
+		if (!dev->drv[i])
+			continue;
 
 		cmd.driver = i;
 		cmd.arg = 0;
@@ -99,7 +101,10 @@
 {
 	int i;
 
-	for (i = 0; i < dev->drivers; i++)
+	for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
+		if (!dev->drv[i])
+			continue;
+
 		if (dev->drv[i]->locks > 0) {
 			isdn_ctrl cmd;
 
@@ -109,6 +114,7 @@
 			isdn_command(&cmd);
 			dev->drv[i]->locks--;
 		}
+	}
 }
 
 void

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)