Commit 2cb28602 authored by Andrew Morton's avatar Andrew Morton Committed by David Mosberger

[PATCH] radio-cadet.c: remove unnecessary copy_to_user()

From: Hollis Blanchard <hollisb@us.ibm.com>

As pointed out by the Stanford checker, 'v' is not tainted.  The driver
shouldn't be using copy_to_user() in cadet_do_ioctl() at all:

  cadet_do_ioctl() is being called by drivers/media/video/videodev.c:
  video_usercopy(), which has already copied the buffer 'arg' (aka 'v')
  into kernel space, and will copy it back after cadet_do_ioctl()
  returns.  So all the direct 'v' accesses are correct.
parent 1b3b38f8
...@@ -389,9 +389,6 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file, ...@@ -389,9 +389,6 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file,
v->flags|=VIDEO_TUNER_STEREO_ON; v->flags|=VIDEO_TUNER_STEREO_ON;
} }
v->flags|=cadet_getrds(); v->flags|=cadet_getrds();
if(copy_to_user(arg,&v, sizeof(v))) {
return -EFAULT;
}
break; break;
case 1: case 1:
strcpy(v->name,"AM"); strcpy(v->name,"AM");
...@@ -402,9 +399,6 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file, ...@@ -402,9 +399,6 @@ static int cadet_do_ioctl(struct inode *inode, struct file *file,
v->mode=0; v->mode=0;
v->mode|=VIDEO_MODE_AUTO; v->mode|=VIDEO_MODE_AUTO;
v->signal=sigstrength; v->signal=sigstrength;
if(copy_to_user(arg,&v, sizeof(v))) {
return -EFAULT;
}
break; break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment