diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2016-04-30 00:11:12 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-27 00:25:30 +0200 |
commit | 79f18a0637033f588accaa05621225c60301514a (patch) | |
tree | 8a22e03c921308359c3e1648ebf9f71efad76b18 /drivers/ide | |
parent | cmd640: add __init attribute (diff) | |
download | linux-79f18a0637033f588accaa05621225c60301514a.tar.xz linux-79f18a0637033f588accaa05621225c60301514a.zip |
ide-tape: fix misprint in failure handling in idetape_init()
If driver_register() failed there is no sense to call driver_unregister().
unregister_chrdev() should be called here.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-tape.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 12fa04997dcc..9ecf4e35adcd 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -2052,12 +2052,12 @@ static int __init idetape_init(void) error = driver_register(&idetape_driver.gen_driver); if (error) - goto out_free_driver; + goto out_free_chrdev; return 0; -out_free_driver: - driver_unregister(&idetape_driver.gen_driver); +out_free_chrdev: + unregister_chrdev(IDETAPE_MAJOR, "ht"); out_free_class: class_destroy(idetape_sysfs_class); out: |