aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ppdev.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2012-09-01 16:31:58 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 16:44:04 -0400
commit9a32bb39d6a48d435135695763e5e4a06652eeda (patch)
tree7f02a8cd4bbeec8e87eced34ca0bc51dd0c812c1 /drivers/char/ppdev.c
parent0bf5a8be4723fd5f243d9d1ed8e6eb9d81f31cf2 (diff)
ppdev: ppdev_init: do not return zero in case of failure
Error handling of parport_register_driver() in ppdev_init() is broken because it deallocates all resources but still returns zero. Currently parport_register_driver() always succeeds. Nevertheless it is worth to fix the issue. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/ppdev.c')
-rw-r--r--drivers/char/ppdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 3fcf80ff12f2..d0d824ebf2c1 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -783,7 +783,8 @@ static int __init ppdev_init (void)
783 err = PTR_ERR(ppdev_class); 783 err = PTR_ERR(ppdev_class);
784 goto out_chrdev; 784 goto out_chrdev;
785 } 785 }
786 if (parport_register_driver(&pp_driver)) { 786 err = parport_register_driver(&pp_driver);
787 if (err < 0) {
787 printk (KERN_WARNING CHRDEV ": unable to register with parport\n"); 788 printk (KERN_WARNING CHRDEV ": unable to register with parport\n");
788 goto out_class; 789 goto out_class;
789 } 790 }