ChangeSet 1.1145, 2003/09/24 13:15:45-07:00, greg@kroah.com [PATCH] USB: fix up two locking issues in mdc800 and vicam drivers These were introduced by my previous copy_to_user audit and noticed by Sergey Vlasov drivers/usb/mdc800.c | 4 +++- drivers/usb/vicam.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff -Nru a/drivers/usb/mdc800.c b/drivers/usb/mdc800.c --- a/drivers/usb/mdc800.c Thu Sep 25 16:03:50 2003 +++ b/drivers/usb/mdc800.c Thu Sep 25 16:03:50 2003 @@ -726,8 +726,10 @@ else { /* memcpy Bytes */ - if (copy_to_user(ptr, &mdc800->out [mdc800->out_ptr], sts)) + if (copy_to_user(ptr, &mdc800->out [mdc800->out_ptr], sts)) { + up (&mdc800->io_lock); return -EFAULT; + } ptr+=sts; left-=sts; mdc800->out_ptr+=sts; diff -Nru a/drivers/usb/vicam.c b/drivers/usb/vicam.c --- a/drivers/usb/vicam.c Thu Sep 25 16:03:50 2003 +++ b/drivers/usb/vicam.c Thu Sep 25 16:03:50 2003 @@ -1004,8 +1004,10 @@ if (count > cam->framebuf_size) count = cam->framebuf_size; - if (copy_to_user(buf, cam->framebuf, count)) + if (copy_to_user(buf, cam->framebuf, count)) { + up(&cam->busy_lock); return -EFAULT; + } if (count != cam->framebuf_size) cam->framebuf_read_start = count;