]> git.hungrycats.org Git - linux/commitdiff
[PATCH] missing copy_from_user check in mixcom driver.
authorDave Jones <davej@redhat.com>
Wed, 13 Aug 2003 16:12:20 +0000 (09:12 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 13 Aug 2003 16:12:20 +0000 (09:12 -0700)
drivers/net/wan/comx-hw-mixcom.c

index 3b5c7388163e5c397fdfb30300a0013ca81493bf..0881f7e175631e60602d414cf8d15c3e1bb2d7ba 100644 (file)
@@ -763,7 +763,10 @@ static int mixcom_write_proc(struct file *file, const char *buffer,
                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 -EFAULT;
+       }
        if (*(page + count - 1) == '\n') {
                *(page + count - 1) = 0;
        }