diff -u --recursive --new-file org/linux-2.2.13.SuSE/drivers/isdn/isdn_common.c linux/drivers/isdn/isdn_common.c --- org/linux-2.2.13.SuSE/drivers/isdn/isdn_common.c Wed Oct 20 02:14:01 1999 +++ linux/drivers/isdn/isdn_common.c Sat Oct 30 14:06:42 1999 @@ -371,6 +390,7 @@ #include #include #include +#include #include #include "isdn_common.h" #include "isdn_tty.h" @@ -2098,7 +2118,7 @@ save_flags(flags); cli(); for (i = 0; i < ISDN_MAX_CHANNELS; i++) - if (((dev->usage[i] & ISDN_USAGE_MASK) == usage) && + if (((!usage) || ((dev->usage[i] & ISDN_USAGE_MASK) == usage)) && (dev->drvmap[i] == di) && (dev->chanmap[i] == ch)) { dev->usage[i] &= (ISDN_USAGE_NONE | ISDN_USAGE_EXCLUSIVE); @@ -2470,8 +2490,7 @@ int i; char tmprev[50]; - sti(); - if (!(dev = (isdn_dev *) kmalloc(sizeof(isdn_dev), GFP_KERNEL))) { + if (!(dev = (isdn_dev *) vmalloc(sizeof(isdn_dev)))) { printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); return -EIO; } @@ -2487,7 +2506,7 @@ } if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) { printk(KERN_WARNING "isdn: Could not register control devices\n"); - kfree(dev); + vfree(dev); return -EIO; } if ((i = isdn_tty_modem_init()) < 0) { @@ -2496,7 +2515,7 @@ tty_unregister_driver(&dev->mdm.cua_modem); if (i <= -2) tty_unregister_driver(&dev->mdm.tty_modem); - kfree(dev); + vfree(dev); unregister_chrdev(ISDN_MAJOR, "isdn"); return -EIO; } @@ -2508,7 +2527,7 @@ for (i = 0; i < ISDN_MAX_CHANNELS; i++) kfree(dev->mdm.info[i].xmit_buf - 4); unregister_chrdev(ISDN_MAJOR, "isdn"); - kfree(dev); + vfree(dev); return -EIO; } #endif /* CONFIG_ISDN_PPP */ @@ -2577,7 +2596,7 @@ printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n"); } else { del_timer(&dev->timer); - kfree(dev); + vfree(dev); printk(KERN_NOTICE "ISDN-subsystem unloaded\n"); } restore_flags(flags);