Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248651
b: refs/heads/master
c: d554350
h: refs/heads/master
i:
  248649: e1bf4dd
  248647: 79f33cc
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 19, 2011
1 parent d1ca3cb commit 22951a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d65c57f4ece4c31380eef9975a04840df7b260cc
refs/heads/master: d55435037539837a741d54690427d37f96ed87fa
23 changes: 12 additions & 11 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,16 +1391,15 @@ struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx,
return ERR_PTR(-ENODEV);

tty = alloc_tty_struct();
if (!tty)
goto fail_no_mem;
if (!tty) {
retval = -ENOMEM;
goto err_module_put;
}
initialize_tty_struct(tty, driver, idx);

retval = tty_driver_install_tty(driver, tty);
if (retval < 0) {
free_tty_struct(tty);
module_put(driver->owner);
return ERR_PTR(retval);
}
if (retval < 0)
goto err_free_tty;

/*
* Structures all installed ... call the ldisc open routines.
Expand All @@ -1409,15 +1408,17 @@ struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx,
*/
retval = tty_ldisc_setup(tty, tty->link);
if (retval)
goto release_mem_out;
goto err_release_tty;
return tty;

fail_no_mem:
err_free_tty:
free_tty_struct(tty);
err_module_put:
module_put(driver->owner);
return ERR_PTR(-ENOMEM);
return ERR_PTR(retval);

/* call the tty release_tty routine to clean out this slot */
release_mem_out:
err_release_tty:
if (printk_ratelimit())
printk(KERN_INFO "tty_init_dev: ldisc open failed, "
"clearing slot %d\n", idx);
Expand Down

0 comments on commit 22951a7

Please sign in to comment.