aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/i4l/isdn_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/i4l/isdn_common.c')
-rw-r--r--drivers/isdn/i4l/isdn_common.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index b26e509ec759..9f6c6375ff75 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/poll.h> 16#include <linux/poll.h>
@@ -340,6 +339,16 @@ isdn_command(isdn_ctrl *cmd)
340 printk(KERN_WARNING "isdn_command command(%x) driver -1\n", cmd->command); 339 printk(KERN_WARNING "isdn_command command(%x) driver -1\n", cmd->command);
341 return(1); 340 return(1);
342 } 341 }
342 if (!dev->drv[cmd->driver]) {
343 printk(KERN_WARNING "isdn_command command(%x) dev->drv[%d] NULL\n",
344 cmd->command, cmd->driver);
345 return(1);
346 }
347 if (!dev->drv[cmd->driver]->interface) {
348 printk(KERN_WARNING "isdn_command command(%x) dev->drv[%d]->interface NULL\n",
349 cmd->command, cmd->driver);
350 return(1);
351 }
343 if (cmd->command == ISDN_CMD_SETL2) { 352 if (cmd->command == ISDN_CMD_SETL2) {
344 int idx = isdn_dc2minor(cmd->driver, cmd->arg & 255); 353 int idx = isdn_dc2minor(cmd->driver, cmd->arg & 255);
345 unsigned long l2prot = (cmd->arg >> 8) & 255; 354 unsigned long l2prot = (cmd->arg >> 8) & 255;
@@ -1903,6 +1912,11 @@ isdn_free_channel(int di, int ch, int usage)
1903{ 1912{
1904 int i; 1913 int i;
1905 1914
1915 if ((di < 0) || (ch < 0)) {
1916 printk(KERN_WARNING "%s: called with invalid drv(%d) or channel(%d)\n",
1917 __FUNCTION__, di, ch);
1918 return;
1919 }
1906 for (i = 0; i < ISDN_MAX_CHANNELS; i++) 1920 for (i = 0; i < ISDN_MAX_CHANNELS; i++)
1907 if (((!usage) || ((dev->usage[i] & ISDN_USAGE_MASK) == usage)) && 1921 if (((!usage) || ((dev->usage[i] & ISDN_USAGE_MASK) == usage)) &&
1908 (dev->drvmap[i] == di) && 1922 (dev->drvmap[i] == di) &&
@@ -1918,7 +1932,8 @@ isdn_free_channel(int di, int ch, int usage)
1918 dev->v110[i] = NULL; 1932 dev->v110[i] = NULL;
1919// 20.10.99 JIM, try to reinitialize v110 ! 1933// 20.10.99 JIM, try to reinitialize v110 !
1920 isdn_info_update(); 1934 isdn_info_update();
1921 skb_queue_purge(&dev->drv[di]->rpqueue[ch]); 1935 if (dev->drv[di])
1936 skb_queue_purge(&dev->drv[di]->rpqueue[ch]);
1922 } 1937 }
1923} 1938}
1924 1939