From: Jon Smirl Date: Tue, 14 Jun 2005 13:54:54 +0000 (-0400) Subject: [PATCH] SYSFS: fix PAGE_SIZE check X-Git-Tag: v2.6.13-rc1~68^2~583^2^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d9d27fb651a7c95a46f276bacb4329db47470a6;p=linux-2.6 [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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 1481cae7d9..849aac1154 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -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;