Skip to content

Commit 760df73

Browse files
authored
Merge pull request #168 from linD026/master
Fix dereference NULL pointer with proc_lseek
2 parents 422f387 + 0f9c726 commit 760df73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/sleep.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,15 @@ static const struct proc_ops file_ops_4_our_proc_file = {
169169
.proc_write = module_input, /* "write" to the file */
170170
.proc_open = module_open, /* called when the /proc file is opened */
171171
.proc_release = module_close, /* called when it's closed */
172+
.proc_lseek = noop_llseek, /* return file->f_pos */
172173
};
173174
#else
174175
static const struct file_operations file_ops_4_our_proc_file = {
175176
.read = module_output,
176177
.write = module_input,
177178
.open = module_open,
178179
.release = module_close,
180+
.llseek = noop_llseek,
179181
};
180182
#endif
181183

0 commit comments

Comments
 (0)