2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-20 16:46:23 +08:00

[PATCH] SYSFS: fix PAGE_SIZE check

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 <jonsmirl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Jon Smirl 2005-06-14 09:54:54 -04:00 committed by Greg Kroah-Hartman
parent 42b16c051c
commit 9d9d27fb65

View File

@ -182,7 +182,7 @@ fill_write_buffer(struct sysfs_buffer * buffer, const char __user * buf, size_t
return -ENOMEM; return -ENOMEM;
if (count >= PAGE_SIZE) if (count >= PAGE_SIZE)
count = PAGE_SIZE - 1; count = PAGE_SIZE;
error = copy_from_user(buffer->page,buf,count); error = copy_from_user(buffer->page,buf,count);
buffer->needs_read_fill = 1; buffer->needs_read_fill = 1;
return error ? -EFAULT : count; return error ? -EFAULT : count;