diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-08-16 09:16:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 15:07:23 -0400 |
commit | c3a6344ae475763b6fb0fb2ec3639004f500d0f1 (patch) | |
tree | 3279f1e5f5651d322a2177da2108f465bd9c194d /drivers/tty/pty.c | |
parent | 88ed2a60610974443335c924d7cb8e5dcf9dbdc1 (diff) |
TTY: tty_alloc_driver() returns error pointers
We changed these from alloc_tty_driver() to tty_alloc_driver() so the
error handling needs to modified to check for IS_ERR() instead of NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/pty.c')
-rw-r--r-- | drivers/tty/pty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index f5a27c66ff60..2bace847eb39 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c | |||
@@ -448,14 +448,14 @@ static void __init legacy_pty_init(void) | |||
448 | TTY_DRIVER_RESET_TERMIOS | | 448 | TTY_DRIVER_RESET_TERMIOS | |
449 | TTY_DRIVER_REAL_RAW | | 449 | TTY_DRIVER_REAL_RAW | |
450 | TTY_DRIVER_DYNAMIC_ALLOC); | 450 | TTY_DRIVER_DYNAMIC_ALLOC); |
451 | if (!pty_driver) | 451 | if (IS_ERR(pty_driver)) |
452 | panic("Couldn't allocate pty driver"); | 452 | panic("Couldn't allocate pty driver"); |
453 | 453 | ||
454 | pty_slave_driver = tty_alloc_driver(legacy_count, | 454 | pty_slave_driver = tty_alloc_driver(legacy_count, |
455 | TTY_DRIVER_RESET_TERMIOS | | 455 | TTY_DRIVER_RESET_TERMIOS | |
456 | TTY_DRIVER_REAL_RAW | | 456 | TTY_DRIVER_REAL_RAW | |
457 | TTY_DRIVER_DYNAMIC_ALLOC); | 457 | TTY_DRIVER_DYNAMIC_ALLOC); |
458 | if (!pty_slave_driver) | 458 | if (IS_ERR(pty_slave_driver)) |
459 | panic("Couldn't allocate pty slave driver"); | 459 | panic("Couldn't allocate pty slave driver"); |
460 | 460 | ||
461 | pty_driver->driver_name = "pty_master"; | 461 | pty_driver->driver_name = "pty_master"; |
@@ -682,7 +682,7 @@ static void __init unix98_pty_init(void) | |||
682 | TTY_DRIVER_DYNAMIC_DEV | | 682 | TTY_DRIVER_DYNAMIC_DEV | |
683 | TTY_DRIVER_DEVPTS_MEM | | 683 | TTY_DRIVER_DEVPTS_MEM | |
684 | TTY_DRIVER_DYNAMIC_ALLOC); | 684 | TTY_DRIVER_DYNAMIC_ALLOC); |
685 | if (!ptm_driver) | 685 | if (IS_ERR(ptm_driver)) |
686 | panic("Couldn't allocate Unix98 ptm driver"); | 686 | panic("Couldn't allocate Unix98 ptm driver"); |
687 | pts_driver = tty_alloc_driver(NR_UNIX98_PTY_MAX, | 687 | pts_driver = tty_alloc_driver(NR_UNIX98_PTY_MAX, |
688 | TTY_DRIVER_RESET_TERMIOS | | 688 | TTY_DRIVER_RESET_TERMIOS | |
@@ -690,7 +690,7 @@ static void __init unix98_pty_init(void) | |||
690 | TTY_DRIVER_DYNAMIC_DEV | | 690 | TTY_DRIVER_DYNAMIC_DEV | |
691 | TTY_DRIVER_DEVPTS_MEM | | 691 | TTY_DRIVER_DEVPTS_MEM | |
692 | TTY_DRIVER_DYNAMIC_ALLOC); | 692 | TTY_DRIVER_DYNAMIC_ALLOC); |
693 | if (!pts_driver) | 693 | if (IS_ERR(pts_driver)) |
694 | panic("Couldn't allocate Unix98 pts driver"); | 694 | panic("Couldn't allocate Unix98 pts driver"); |
695 | 695 | ||
696 | ptm_driver->driver_name = "pty_master"; | 696 | ptm_driver->driver_name = "pty_master"; |