kernel_optimize_test/drivers/media/video/cx88
Duncan Sands 4a287cfeea V4L/DVB (3394): Bttv: correct bttv_risc_packed buffer size
This patch fixes the strange crashes I was seeing after using
bttv card, caused by a buffer overflow in bttv_risc_packed.
The instruction buffer size calculation contains two errors:
(a) a non-zero padding value can push the start of the next bpl
section to just before a page border, leading to more scanline
splits and thus additional instructions.
(b) the first DMA region can be smaller than one page, so there can
be a scanline split even if bpl*lines is smaller than PAGE_SIZE.
For example, consider the case where offset is 0, bpl is 2, padding
is 4094, lines is smaller than 2048, the first DMA region has size 1
and all others have size PAGE_SIZE, assumed to equal 4096.  Then
all bpl regions cross page borders and the number of instructions
written is 2*lines+2, rather than lines+2 (the current estimate).
With this patch the number of instructions for this example is
estimated to be 2*lines+3.
Also, the BUG_ON that was supposed to catch buffer overflows contained
a thinko causing it fire only if the buffer was overrun by a factor of
16 or more, so it fixes the the BUG_ON's (using sizeof rather than "4").

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-02-27 00:09:48 -03:00
..
cx88-alsa.c V4L/DVB (3318a): Makes Some symbols static. 2006-02-07 06:49:14 -02:00
cx88-blackbird.c V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc 2006-01-11 19:40:56 -02:00
cx88-cards.c V4L/DVB (3380): TUV1236d: declare buffer as static const 2006-02-27 00:09:14 -03:00
cx88-core.c V4L/DVB (3394): Bttv: correct bttv_risc_packed buffer size 2006-02-27 00:09:48 -03:00
cx88-dvb.c V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc 2006-01-11 19:40:56 -02:00
cx88-i2c.c V4L/DVB (3269): ioctls cleanups. 2006-01-09 15:32:31 -02:00
cx88-input.c V4L/DVB (3297): Add IR support to KWorld DVB-T (cx22702-based) 2006-02-07 06:45:33 -02:00
cx88-mpeg.c V4L (0979): Added V4L support for the Nova-S-Plus and Nova-SE2 DVB-S products 2006-01-09 15:25:02 -02:00
cx88-reg.h [PATCH] v4l: 800: whitespace cleanups 2005-11-09 07:56:20 -08:00
cx88-tvaudio.c V4L/DVB (3378): Fix for lack of analog output on some cx88 boards 2006-01-15 09:03:34 -02:00
cx88-vbi.c [PATCH] v4l: CX88 updates and card additions 2005-09-09 13:57:49 -07:00
cx88-video.c V4L/DVB (3393): Cx88: reduce excessive logging 2006-02-27 00:09:45 -03:00
cx88-vp3054-i2c.c V4L/DVB (3356): Include missing MODULE_* macros 2006-01-13 14:10:24 -02:00
cx88-vp3054-i2c.h V4L/DVB (3220): Add support for VP-3054 HDTV board 2006-01-09 15:25:35 -02:00
cx88.h V4L/DVB (3318b): sem2mutex: drivers/media/, #2 2006-02-07 06:49:14 -02:00
Kconfig V4L/DVB (3417): make VP-3054 Secondary I2C Bus Support a Kconfig option. 2006-01-23 17:11:07 -02:00
Makefile V4L/DVB (3442): Allow tristate build for cx88-vp3054-i2c 2006-01-26 04:37:19 -02:00