# CONFIG_NOCONFIG_CHAN is not set
 CONFIG_CON_ZERO_CHAN="fd:0,fd:1"
 CONFIG_CON_CHAN="xterm"
-CONFIG_SSL_CHAN="pty"
+CONFIG_SSL_CHAN="pts"
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 
        }
 }
 
-void enable_chan(struct line *line)
+int enable_chan(struct line *line)
 {
        struct list_head *ele;
        struct chan *chan;
+       int err;
 
        list_for_each(ele, &line->chan_list){
                chan = list_entry(ele, struct chan, list);
-               if(open_one_chan(chan))
+               err = open_one_chan(chan);
+               if (err) {
+                       if (chan->primary)
+                               goto out_close;
+
                        continue;
+               }
 
                if(chan->enabled)
                        continue;
-               line_setup_irq(chan->fd, chan->input, chan->output, line,
-                              chan);
+               err = line_setup_irq(chan->fd, chan->input, chan->output, line,
+                                    chan);
+               if (err)
+                       goto out_close;
+
                chan->enabled = 1;
        }
+
+       return 0;
+
+ out_close:
+       close_chan(&line->chan_list, 0);
+       return err;
 }
 
 /* Items are added in IRQ context, when free_irq can't be called, and
 
        tty->driver_data = line;
        line->tty = tty;
 
-       enable_chan(line);
+       err = enable_chan(line);
+       if (err)
+               return err;
+
        INIT_DELAYED_WORK(&line->task, line_timer_cb);
 
        if(!line->sigio){
 
 
 static int ssl_open(struct tty_struct *tty, struct file *filp)
 {
-       return line_open(serial_lines, tty);
+       int err = line_open(serial_lines, tty);
+
+       if (err)
+               printk(KERN_ERR "Failed to open serial line %d, err = %d\n",
+                      tty->index, err);
+
+       return err;
 }
 
 #if 0
 
 
 static int con_open(struct tty_struct *tty, struct file *filp)
 {
-       return line_open(vts, tty);
+       int err = line_open(vts, tty);
+       if (err)
+               printk(KERN_ERR "Failed to open console %d, err = %d\n",
+                      tty->index, err);
+
+       return err;
 }
 
 /* Set in an initcall, checked in an exitcall */
 
 extern void deactivate_chan(struct list_head *chans, int irq);
 extern void reactivate_chan(struct list_head *chans, int irq);
 extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty);
-extern void enable_chan(struct line *line);
+extern int enable_chan(struct line *line);
 extern void close_chan(struct list_head *chans, int delay_free_irq);
 extern int chan_window_size(struct list_head *chans, 
                             unsigned short *rows_out,