Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248652
b: refs/heads/master
c: 8a1b8d7
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 19, 2011
1 parent 22951a7 commit c603c5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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: d55435037539837a741d54690427d37f96ed87fa
refs/heads/master: 8a1b8d70a07628f294f30485acf81971e3fcc755
19 changes: 10 additions & 9 deletions trunk/drivers/tty/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,22 +295,20 @@ static int pty_install(struct tty_driver *driver, struct tty_struct *tty)
return -ENOMEM;
if (!try_module_get(driver->other->owner)) {
/* This cannot in fact currently happen */
free_tty_struct(o_tty);
return -ENOMEM;
retval = -ENOMEM;
goto err_free_tty;
}
initialize_tty_struct(o_tty, driver->other, idx);

/* We always use new tty termios data so we can do this
the easy way .. */
retval = tty_init_termios(tty);
if (retval)
goto free_mem_out;
goto err_module_put;

retval = tty_init_termios(o_tty);
if (retval) {
tty_free_termios(tty);
goto free_mem_out;
}
if (retval)
goto err_free_termios;

/*
* Everything allocated ... set up the o_tty structure.
Expand All @@ -327,10 +325,13 @@ static int pty_install(struct tty_driver *driver, struct tty_struct *tty)
tty->count++;
driver->ttys[idx] = tty;
return 0;
free_mem_out:
err_free_termios:
tty_free_termios(tty);
err_module_put:
module_put(o_tty->driver->owner);
err_free_tty:
free_tty_struct(o_tty);
return -ENOMEM;
return retval;
}

static int pty_bsd_ioctl(struct tty_struct *tty,
Expand Down

0 comments on commit c603c5e

Please sign in to comment.