media: v4l2: allocate v4l2_clip objects early
[linux-2.6-microblaze.git] / drivers / media / common / saa7146 / saa7146_video.c
index ccd15b4..7b8795e 100644 (file)
@@ -771,10 +771,8 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *__fh, struct v4l2_f
        vv->ov.nclips = f->fmt.win.clipcount;
        if (vv->ov.nclips > 16)
                vv->ov.nclips = 16;
-       if (copy_from_user(vv->ov.clips, f->fmt.win.clips,
-                               sizeof(struct v4l2_clip) * vv->ov.nclips)) {
-               return -EFAULT;
-       }
+       memcpy(vv->ov.clips, f->fmt.win.clips,
+              sizeof(struct v4l2_clip) * vv->ov.nclips);
 
        /* vv->ov.fh is used to indicate that we have valid overlay information, too */
        vv->ov.fh = fh;