public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [media] uvcvideo: remove unneeded access_ok() check
@ 2012-03-21  6:35 Dan Carpenter
  2012-03-21 10:43 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-03-21  6:35 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

copy_in_user() already checks for write permission, so we don't need to
do it here.  This was added in 1a5e4c867c "[media] uvcvideo: Implement
compat_ioctl32 for custom ioctls".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index ff2cddd..111bfff 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -1105,8 +1105,6 @@ static int uvc_v4l2_put_xu_mapping(const struct uvc_xu_control_mapping *kp,
 	if (get_user(p, &up->menu_info))
 		return -EFAULT;
 	umenus = compat_ptr(p);
-	if (!access_ok(VERIFY_WRITE, umenus, kp->menu_count * sizeof(*umenus)))
-		return -EFAULT;
 
 	if (copy_in_user(umenus, kmenus, kp->menu_count * sizeof(*umenus)))
 		return -EFAULT;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-21 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-21  6:35 [patch] [media] uvcvideo: remove unneeded access_ok() check Dan Carpenter
2012-03-21 10:43 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox