aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/chan_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r--arch/um/drivers/chan_kern.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 3aa351611763..368d3e97dfd9 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -203,22 +203,37 @@ void chan_enable_winch(struct list_head *chans, struct tty_struct *tty)
203 } 203 }
204} 204}
205 205
206void enable_chan(struct line *line) 206int enable_chan(struct line *line)
207{ 207{
208 struct list_head *ele; 208 struct list_head *ele;
209 struct chan *chan; 209 struct chan *chan;
210 int err;
210 211
211 list_for_each(ele, &line->chan_list){ 212 list_for_each(ele, &line->chan_list){
212 chan = list_entry(ele, struct chan, list); 213 chan = list_entry(ele, struct chan, list);
213 if(open_one_chan(chan)) 214 err = open_one_chan(chan);
215 if (err) {
216 if (chan->primary)
217 goto out_close;
218
214 continue; 219 continue;
220 }
215 221
216 if(chan->enabled) 222 if(chan->enabled)
217 continue; 223 continue;
218 line_setup_irq(chan->fd, chan->input, chan->output, line, 224 err = line_setup_irq(chan->fd, chan->input, chan->output, line,
219 chan); 225 chan);
226 if (err)
227 goto out_close;
228
220 chan->enabled = 1; 229 chan->enabled = 1;
221 } 230 }
231
232 return 0;
233
234 out_close:
235 close_chan(&line->chan_list, 0);
236 return err;
222} 237}
223 238
224/* Items are added in IRQ context, when free_irq can't be called, and 239/* Items are added in IRQ context, when free_irq can't be called, and