Merge pull request #168 from linD026/master

Fix dereference NULL pointer with proc_lseek
This commit is contained in:
Jim Huang 2022-09-23 13:52:06 +08:00 committed by GitHub
commit 760df73743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,6 +169,7 @@ static const struct proc_ops file_ops_4_our_proc_file = {
.proc_write = module_input, /* "write" to the file */
.proc_open = module_open, /* called when the /proc file is opened */
.proc_release = module_close, /* called when it's closed */
.proc_lseek = noop_llseek, /* return file->f_pos */
};
#else
static const struct file_operations file_ops_4_our_proc_file = {
@ -176,6 +177,7 @@ static const struct file_operations file_ops_4_our_proc_file = {
.write = module_input,
.open = module_open,
.release = module_close,
.llseek = noop_llseek,
};
#endif