Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eg_03_scull_basic/fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ ssize_t scull_read(struct file *filp, char __user *buff, size_t count,
goto end_of_file;
}

if (count > pblock->offset)
count = pblock->offset;
if (count > pblock->offset - toffset)
count = pblock->offset - toffset;

if (copy_to_user(buff, pblock->data, count)) {
retval = -EFAULT;
Expand Down
3 changes: 1 addition & 2 deletions eg_04_proc_fs_basic/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ void __exit m_exit(void)
{
printk(KERN_WARNING MODULE_NAME " unloaded\n");

remove_proc_entry(PROC_FS_NAME, parent);
remove_proc_entry(SUB_DIR_NAME, NULL);
remove_proc_subtree(SUB_DIR_NAME, NULL);
}

module_init(m_init);
Expand Down