[PATCH] sysfs: zero terminate sysfs write buffers

No one should be writing a PAGE_SIZE worth of data to a normal sysfs
file, so properly terminate the buffer.

Thanks to Al Viro for pointing out my supidity here.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Greg Kroah-Hartman and committed by Linus Torvalds 6e0dd741 597a7679

+1 -1
+1 -1
fs/sysfs/file.c
··· 183 return -ENOMEM; 184 185 if (count >= PAGE_SIZE) 186 - count = PAGE_SIZE; 187 error = copy_from_user(buffer->page,buf,count); 188 buffer->needs_read_fill = 1; 189 return error ? -EFAULT : count;
··· 183 return -ENOMEM; 184 185 if (count >= PAGE_SIZE) 186 + count = PAGE_SIZE - 1; 187 error = copy_from_user(buffer->page,buf,count); 188 buffer->needs_read_fill = 1; 189 return error ? -EFAULT : count;