devices/ccat/update.c
branchstable-1.5
changeset 2559 a24ff468cb25
parent 2553 b0c2762a1a83
child 2565 f7b06b264646
--- a/devices/ccat/update.c	Fri Apr 25 17:05:12 2014 +0200
+++ b/devices/ccat/update.c	Fri Apr 25 17:05:39 2014 +0200
@@ -165,7 +165,10 @@
 	if (*off + len > sizeof(update->data))
 		return 0;
 
-	copy_from_user(update->data + *off, buf, len);
+	if (copy_from_user(update->data + *off, buf, len)) {
+		return -EFAULT;
+	}
+
 	*off += len;
 	update->size = *off;
 	return len;