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>
This commit is contained in:
Dan Carpenter
2012-08-16 16:16:56 +03:00
committed by Greg Kroah-Hartman
parent 88ed2a6061
commit c3a6344ae4
4 changed files with 10 additions and 10 deletions

View File

@@ -1048,8 +1048,8 @@ static int __init moxa_init(void)
moxaDriver = tty_alloc_driver(MAX_PORTS + 1,
TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV);
if (!moxaDriver)
return -ENOMEM;
if (IS_ERR(moxaDriver))
return PTR_ERR(moxaDriver);
moxaDriver->name = "ttyMX";
moxaDriver->major = ttymajor;