From 0b7c0034beb2436c8bd87d851fddbaf1106bc0ae Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 5 Jul 2005 09:59:56 +0000 Subject: [PATCH] - handle copy_from_user() error --- lustre/ldlm/ldlm_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 9a88971..9cd393a 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -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, -- 1.8.3.1