Skip to content

Commit d81d968

Browse files
committed
vinput: Fix missing error code
Fix the missing error code when register_chrdev() failed. The report is from Smatch: Smatch failed: 1 warning(s), 0 error(s) /home/runner/work/lkmpg/lkmpg/examples/vinput.c:372 vinput_init() warn: missing error code 'err'
1 parent 9892214 commit d81d968

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/vinput.c

+1
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ static int __init vinput_init(void)
369369
vinput_dev = register_chrdev(0, DRIVER_NAME, &vinput_fops);
370370
if (vinput_dev < 0) {
371371
pr_err("vinput: Unable to allocate char dev region\n");
372+
err = vinput_dev;
372373
goto failed_alloc;
373374
}
374375

0 commit comments

Comments
 (0)