devices/ccat/update.c
branchstable-1.5
changeset 2559 a24ff468cb25
parent 2553 b0c2762a1a83
child 2565 f7b06b264646
equal deleted inserted replaced
2558:4e17a99a6bb4 2559:a24ff468cb25
   163 {
   163 {
   164 	struct update_buffer *const update = f->private_data;
   164 	struct update_buffer *const update = f->private_data;
   165 	if (*off + len > sizeof(update->data))
   165 	if (*off + len > sizeof(update->data))
   166 		return 0;
   166 		return 0;
   167 
   167 
   168 	copy_from_user(update->data + *off, buf, len);
   168 	if (copy_from_user(update->data + *off, buf, len)) {
       
   169 		return -EFAULT;
       
   170 	}
       
   171 
   169 	*off += len;
   172 	*off += len;
   170 	update->size = *off;
   173 	update->size = *off;
   171 	return len;
   174 	return len;
   172 }
   175 }
   173 
   176