ChangeSet 1.1042.84.2, 2003/05/01 23:54:37-07:00, greg@kroah.com [PATCH] USB: vicam: fix bugs in writing to proc files that were found by the CHECKER project drivers/usb/media/vicam.c | 30 ++---------------------------- 1 files changed, 2 insertions(+), 28 deletions(-) diff -Nru a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c --- a/drivers/usb/media/vicam.c Wed May 7 11:13:12 2003 +++ b/drivers/usb/media/vicam.c Wed May 7 11:13:12 2003 @@ -1101,28 +1101,6 @@ ((struct vicam_camera *)data)->gain); } -static int vicam_write_proc_shutter(struct file *file, const char *buffer, - unsigned long count, void *data) -{ - struct vicam_camera *cam = (struct vicam_camera *)data; - - cam->shutter_speed = simple_strtoul(buffer, NULL, 10); - - return count; -} - -static int vicam_write_proc_gain(struct file *file, const char *buffer, - unsigned long count, void *data) -{ - struct vicam_camera *cam = (struct vicam_camera *)data; - - cam->gain = simple_strtoul(buffer, NULL, 10); - - return count; -} - - - static void vicam_create_proc_root(void) { @@ -1164,21 +1142,17 @@ if ( !cam->proc_dir ) return; // We should probably return an error here ent = - create_proc_entry("shutter", S_IFREG | S_IRUGO | S_IWUSR, - cam->proc_dir); + create_proc_entry("shutter", S_IFREG | S_IRUGO, cam->proc_dir); if (ent) { ent->data = cam; ent->read_proc = vicam_read_proc_shutter; - ent->write_proc = vicam_write_proc_shutter; ent->size = 64; } - ent = create_proc_entry("gain", S_IFREG | S_IRUGO | S_IWUSR, - cam->proc_dir); + ent = create_proc_entry("gain", S_IFREG | S_IRUGO , cam->proc_dir); if ( ent ) { ent->data = cam; ent->read_proc = vicam_read_proc_gain; - ent->write_proc = vicam_write_proc_gain; ent->size = 64; } }