Commit 66154b6e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] write_kmem() fix

copy_from_user() returns non-zero on faults..
parent fbd033be
...@@ -311,7 +311,7 @@ static ssize_t write_kmem(struct file * file, const char * buf, ...@@ -311,7 +311,7 @@ static ssize_t write_kmem(struct file * file, const char * buf,
len = PAGE_SIZE; len = PAGE_SIZE;
if (len) { if (len) {
written = copy_from_user(kbuf, buf, len); written = copy_from_user(kbuf, buf, len);
if (written != len) { if (written) {
ssize_t ret; ssize_t ret;
free_page((unsigned long)kbuf); free_page((unsigned long)kbuf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment