Skip to content

Commit

Permalink
Fix incorrect failure handling in vinput_init
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NOVBobLee committed Oct 20, 2024
1 parent e2b1756 commit 9b89d0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/vinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9b89d0c

Please sign in to comment.