Commit 115bbb11 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] Missing copy_from_user check in comx driver

parent bd3fda33
...@@ -339,7 +339,10 @@ static int locomx_write_proc(struct file *file, const char *buffer, ...@@ -339,7 +339,10 @@ static int locomx_write_proc(struct file *file, const char *buffer,
return -ENOMEM; return -ENOMEM;
} }
copy_from_user(page, buffer, count = min_t(unsigned long, count, PAGE_SIZE)); if (copy_from_user(page, buffer, count = min_t(unsigned long, count, PAGE_SIZE))) {
free_page((unsigned long)page);
return -EBADF;
}
if (*(page + count - 1) == '\n') { if (*(page + count - 1) == '\n') {
*(page + count - 1) = 0; *(page + count - 1) = 0;
} }
......
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