This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/media_tree.git tree:
Subject: [media] gspca_main: Update buffer flags even when user_copy fails Author: Hans de Goede <[email protected]> Date: Thu Dec 30 20:00:17 2010 -0300 Before this patch dqbuf errors out on a failing user_copy (with user pointers) before updating the buffer flags, causing a successsfully dequeued buffer to still have the DONE flag, which means that it could no longer be re-queueud (assuming the app somehow survives the segfault). Signed-off-by: Hans de Goede <[email protected]> Acked-by: Jean-Francois Moine <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> drivers/media/video/gspca/gspca.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) --- http://git.linuxtv.org/media_tree.git?a=commitdiff;h=d2614760c1d084f3739e2bc0c174bf16195cc603 diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 64ecf66..fbc5666 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -1912,6 +1912,11 @@ static int vidioc_dqbuf(struct file *file, void *priv, mutex_unlock(&gspca_dev->usb_lock); } + frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE; + memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf); + PDEBUG(D_FRAM, "dqbuf %d", j); + ret = 0; + if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { if (copy_to_user((__u8 __user *) frame->v4l2_buf.m.userptr, frame->data, @@ -1919,13 +1924,8 @@ static int vidioc_dqbuf(struct file *file, void *priv, PDEBUG(D_ERR|D_STREAM, "dqbuf cp to user failed"); ret = -EFAULT; - goto out; } } - frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE; - memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf); - PDEBUG(D_FRAM, "dqbuf %d", j); - ret = 0; out: mutex_unlock(&gspca_dev->queue_lock); return ret; _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
