Skip to content

Commit

Permalink
ide-tape: fix misprint in failure handling in idetape_init()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
khoroshilov authored and davem330 committed Jul 26, 2016
1 parent 40506d4 commit 79f18a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 79f18a0

Please sign in to comment.