mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 08:18:47 +00:00
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>
This commit is contained in:
parent
0bf5a8be47
commit
9a32bb39d6
@ -783,7 +783,8 @@ static int __init ppdev_init (void)
|
|||||||
err = PTR_ERR(ppdev_class);
|
err = PTR_ERR(ppdev_class);
|
||||||
goto out_chrdev;
|
goto out_chrdev;
|
||||||
}
|
}
|
||||||
if (parport_register_driver(&pp_driver)) {
|
err = parport_register_driver(&pp_driver);
|
||||||
|
if (err < 0) {
|
||||||
printk (KERN_WARNING CHRDEV ": unable to register with parport\n");
|
printk (KERN_WARNING CHRDEV ": unable to register with parport\n");
|
||||||
goto out_class;
|
goto out_class;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user