Skip to content
Open
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