Whamcloud - gitweb
- handle copy_from_user() error
authoralex <alex>
Tue, 5 Jul 2005 09:59:56 +0000 (09:59 +0000)
committeralex <alex>
Tue, 5 Jul 2005 09:59:56 +0000 (09:59 +0000)
lustre/ldlm/ldlm_resource.c

index 9a88971..9cd393a 100644 (file)
@@ -140,7 +140,8 @@ static int lprocfs_write_lru_size(struct file *file, const char *buffer,
         unsigned long tmp;
 
         dummy[MAX_STRING_SIZE] = '\0';
-        copy_from_user(dummy, buffer, MAX_STRING_SIZE);
+        if (copy_from_user(dummy, buffer, MAX_STRING_SIZE))
+                return -EFAULT;
 
         if (count == 6 && memcmp(dummy, "clear", 5) == 0) {
                 CDEBUG(D_DLMTRACE,