Fix incorrect failure handling in vinput_init

After class_register failure, the wrong function class_unregister was
used. The correct cleanup function should be unregister_chrdev, as
register_chrdev was used before class_register.
This commit is contained in:
Bob Lee 2024-10-21 00:33:06 +08:00
parent e2b1756efc
commit 9b89d0ca04
No known key found for this signature in database
GPG Key ID: 0DA954476306EEFA

View File

@ -401,7 +401,7 @@ static int __init vinput_init(void)
return 0;
failed_class:
class_unregister(&vinput_class);
unregister_chrdev(vinput_dev, DRIVER_NAME);
failed_alloc:
return err;
}