diff mbox

[1/3] v4l2: vb2: one more fix for REQBUFS()

Message ID 1299760122-29493-2-git-send-email-m.szyprowski@samsung.com (mailing list archive)
State RFC
Headers show

Commit Message

Marek Szyprowski March 10, 2011, 12:28 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c
index c5f99c7..9df484d 100644
--- a/drivers/media/video/videobuf2-core.c
+++ b/drivers/media/video/videobuf2-core.c
@@ -488,6 +488,13 @@  int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
 		return -EINVAL;
 	}
 
+	/*
+	 * If the same number of buffers and memory access method is requested
+	 * then return immedietely.
+	 */
+	if (q->memory == req->memory && req->count == q->num_buffers)
+		return 0;
+
 	if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) {
 		/*
 		 * We already have buffers allocated, so first check if they