Skip to content

Commit 9b89d0c

Browse files
committed
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.
1 parent e2b1756 commit 9b89d0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/vinput.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int __init vinput_init(void)
401401

402402
return 0;
403403
failed_class:
404-
class_unregister(&vinput_class);
404+
unregister_chrdev(vinput_dev, DRIVER_NAME);
405405
failed_alloc:
406406
return err;
407407
}

0 commit comments

Comments
 (0)