diff options
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r-- | arch/um/drivers/chan_kern.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 59c9b3f7c840..31b69c4ea800 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -311,14 +311,12 @@ int console_write_chan(struct list_head *chans, const char *buf, int len) | |||
311 | int console_open_chan(struct line *line, struct console *co, | 311 | int console_open_chan(struct line *line, struct console *co, |
312 | struct chan_opts *opts) | 312 | struct chan_opts *opts) |
313 | { | 313 | { |
314 | if (!list_empty(&line->chan_list)) | 314 | int err; |
315 | return 0; | 315 | |
316 | err = open_chan(&line->chan_list); | ||
317 | if(err) | ||
318 | return err; | ||
316 | 319 | ||
317 | if (0 != parse_chan_pair(line->init_str, &line->chan_list, | ||
318 | co->index, opts)) | ||
319 | return -1; | ||
320 | if (0 != open_chan(&line->chan_list)) | ||
321 | return -1; | ||
322 | printk("Console initialized on /dev/%s%d\n",co->name,co->index); | 320 | printk("Console initialized on /dev/%s%d\n",co->name,co->index); |
323 | return 0; | 321 | return 0; |
324 | } | 322 | } |
@@ -596,13 +594,11 @@ void chan_interrupt(struct list_head *chans, struct work_struct *task, | |||
596 | tty_hangup(tty); | 594 | tty_hangup(tty); |
597 | line_disable(tty, irq); | 595 | line_disable(tty, irq); |
598 | close_chan(chans); | 596 | close_chan(chans); |
599 | free_chan(chans); | ||
600 | return; | 597 | return; |
601 | } | 598 | } |
602 | else { | 599 | else { |
603 | if(chan->ops->close != NULL) | 600 | if(chan->ops->close != NULL) |
604 | chan->ops->close(chan->fd, chan->data); | 601 | chan->ops->close(chan->fd, chan->data); |
605 | free_one_chan(chan); | ||
606 | } | 602 | } |
607 | } | 603 | } |
608 | } | 604 | } |