* [PATCH] ide-tape: fix misprint in failure handling in idetape_init()
@ 2016-04-29 22:11 Alexey Khoroshilov
2016-07-26 22:26 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2016-04-29 22:11 UTC (permalink / raw)
To: David S. Miller; +Cc: Alexey Khoroshilov, linux-ide, linux-kernel, ldv-project
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>
---
drivers/ide/ide-tape.c | 6 +++---
1 file 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:
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ide-tape: fix misprint in failure handling in idetape_init()
2016-04-29 22:11 [PATCH] ide-tape: fix misprint in failure handling in idetape_init() Alexey Khoroshilov
@ 2016-07-26 22:26 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-26 22:26 UTC (permalink / raw)
To: khoroshilov; +Cc: linux-ide, linux-kernel, ldv-project
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Sat, 30 Apr 2016 01:11:12 +0300
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-26 22:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29 22:11 [PATCH] ide-tape: fix misprint in failure handling in idetape_init() Alexey Khoroshilov
2016-07-26 22:26 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).