Commit 85b00e35 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] missing copy_from_user check in munich driver

parent 3bff8cb9
...@@ -2414,7 +2414,10 @@ static int munich_write_proc(struct file *file, const char *buffer, ...@@ -2414,7 +2414,10 @@ static int munich_write_proc(struct file *file, const char *buffer,
return -ENOMEM; return -ENOMEM;
/* Copy user data and cut trailing \n */ /* Copy user data and cut trailing \n */
copy_from_user(page, buffer, count = min(count, PAGE_SIZE)); if (copy_from_user(page, buffer, count = min(count, PAGE_SIZE))) {
free_page((unsigned long)page);
return -EFAULT;
}
if (*(page + count - 1) == '\n') if (*(page + count - 1) == '\n')
*(page + count - 1) = 0; *(page + count - 1) = 0;
*(page + PAGE_SIZE - 1) = 0; *(page + PAGE_SIZE - 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