diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-12 09:20:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-12 09:20:47 +0300 |
commit | 7bf1e44f865523aa16e0eb340a82d643da9215b5 (patch) | |
tree | 1ddb344169d39413053057d888edbb18dfeed880 /drivers/tty/ehv_bytechan.c | |
parent | e5770b7bdbfe9f23bb75a7d5a88c1f5e18e20738 (diff) | |
parent | 32c1431eea4881a6b17bd7c639315010aeefa452 (diff) | |
download | linux-7bf1e44f865523aa16e0eb340a82d643da9215b5.tar.xz |
Merge 4.12-rc5 into staging-next
We want the IIO fixes and other staging driver fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/ehv_bytechan.c')
-rw-r--r-- | drivers/tty/ehv_bytechan.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index 7ac9bcdf1e61..61fe8d6fd24e 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -764,7 +764,7 @@ static int __init ehv_bc_init(void) ehv_bc_driver = alloc_tty_driver(count); if (!ehv_bc_driver) { ret = -ENOMEM; - goto error; + goto err_free_bcs; } ehv_bc_driver->driver_name = "ehv-bc"; @@ -778,24 +778,23 @@ static int __init ehv_bc_init(void) ret = tty_register_driver(ehv_bc_driver); if (ret) { pr_err("ehv-bc: could not register tty driver (ret=%i)\n", ret); - goto error; + goto err_put_tty_driver; } ret = platform_driver_register(&ehv_bc_tty_driver); if (ret) { pr_err("ehv-bc: could not register platform driver (ret=%i)\n", ret); - goto error; + goto err_deregister_tty_driver; } return 0; -error: - if (ehv_bc_driver) { - tty_unregister_driver(ehv_bc_driver); - put_tty_driver(ehv_bc_driver); - } - +err_deregister_tty_driver: + tty_unregister_driver(ehv_bc_driver); +err_put_tty_driver: + put_tty_driver(ehv_bc_driver); +err_free_bcs: kfree(bcs); return ret; |