patch-2.3.99-pre6 linux/drivers/net/pcmcia/ray_cs.c

Next file: linux/drivers/net/pcmcia/xircom_tulip_cb.c
Previous file: linux/drivers/net/pcmcia/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/drivers/net/pcmcia/ray_cs.c linux/drivers/net/pcmcia/ray_cs.c
@@ -1494,16 +1494,19 @@
     dev_link_t *link;
     ray_dev_t *local = (ray_dev_t *)dev->priv;
     
+    MOD_INC_USE_COUNT;
+
     DEBUG(1, "ray_open('%s')\n", dev->name);
 
     for (link = dev_list; link; link = link->next)
         if (link->priv == dev) break;
-    if (!DEV_OK(link))
+    if (!DEV_OK(link)) {
+        MOD_DEC_USE_COUNT;
         return -ENODEV;
+    }
 
     if (link->open == 0) local->num_multi = 0;
     link->open++;
-    MOD_INC_USE_COUNT;
 
     if (sniffer) netif_stop_queue(dev);
     else         netif_start_queue(dev);

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