mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 15:50:59 +07:00
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>
This commit is contained in:
parent
40506d4022
commit
79f18a0637
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user