]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] cx25821: fix sparse warning
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 21 Aug 2014 14:26:29 +0000 (11:26 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 3 Sep 2014 13:32:02 +0000 (10:32 -0300)
drivers/media/pci/cx25821/cx25821-video-upstream.c:334:25: warning: incorrect type in argument 2 (different address spaces)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/pci/cx25821/cx25821-video-upstream.c

index 1f43be0b04c8e91dc5012275d3d040eb0bd92a2d..a664997e1958dccdba7fbf6315d1d5b4606ca084 100644 (file)
@@ -330,8 +330,9 @@ int cx25821_write_frame(struct cx25821_channel *chan,
 
        if (frame_size - curpos < count)
                count = frame_size - curpos;
-       memcpy((char *)out->_data_buf_virt_addr + frame_offset + curpos,
-                       data, count);
+       if (copy_from_user((__force char *)out->_data_buf_virt_addr + frame_offset + curpos,
+                               data, count))
+               return -EFAULT;
        curpos += count;
        if (curpos == frame_size) {
                out->_frame_count++;