In cx18_stream_alloc(), s->mdl_offset was being used
uninitialized/memset to 0 in the call to cx18_stream_alloc(), for every
stream, to do a bounds check on accumulated allocations. This appears
to be incorrect.
I believe the intent was to use the current running total in
cx->mdl_offset to perform the bounds check.
Please inspect the attached patch to make sure it makes sense. I'm not
100% sure of my current understanding of the mdl_offset variables.
Regards,
Andy
--- cx18-2df0b7cc7a5c/linux/drivers/media/video/cx18/cx18-queue.c.orig 2008-03-07 22:45:46.000000000 -0500
+++ cx18-2df0b7cc7a5c/linux/drivers/media/video/cx18/cx18-queue.c 2008-03-07 22:46:56.000000000 -0500
@@ -218,7 +218,7 @@ int cx18_stream_alloc(struct cx18_stream
CX18_DEBUG_INFO("Allocate %s stream: %d x %d buffers (%dkB total)\n",
s->name, s->buffers, s->buf_size, s->buffers * s->buf_size / 1024);
- if (((char *)&cx->scb->cpu_mdl[s->mdl_offset + s->buffers] - (char *)cx->scb) > SCB_RESERVED_SIZE) {
+ if (((char *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - (char *)cx->scb) > SCB_RESERVED_SIZE) {
CX18_ERR("Too many buffers, cannot fit in SCB area\n");
CX18_ERR("Max buffers = %zd\n",
(((char *)cx->scb) + SCB_RESERVED_SIZE - ((char *)cx->scb->cpu_mdl)) /
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel