Skip to content

Commit

Permalink
[PATCH] SYSFS: fix PAGE_SIZE check
Browse files Browse the repository at this point in the history
Without this change I can't set an attribute exactly PAGE_SIZE in
length. There is no need for zero termination because the interface
uses lengths.

From: Jon Smirl <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jonsmirl authored and gregkh committed Jun 20, 2005
1 parent 42b16c0 commit 9d9d27f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/sysfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ fill_write_buffer(struct sysfs_buffer * buffer, const char __user * buf, size_t
return -ENOMEM;

if (count >= PAGE_SIZE)
count = PAGE_SIZE - 1;
count = PAGE_SIZE;
error = copy_from_user(buffer->page,buf,count);
buffer->needs_read_fill = 1;
return error ? -EFAULT : count;
Expand Down

0 comments on commit 9d9d27f

Please sign in to comment.