]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB (8546): saa7146: fix read from uninitialized memory
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 27 Jul 2008 17:08:54 +0000 (14:08 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 27 Jul 2008 21:07:58 +0000 (18:07 -0300)
commitb34a2f36137fdea4b90b806b5a017f692dd8c62f
tree2e71b21410b5c0b6970eab25cb5098687a83dd0d
parent7f822f85e720a27a9847977b1bcf44756bddfc20
V4L/DVB (8546): saa7146: fix read from uninitialized memory

The offset field of the scatterlist entry *after* the last valid scatterlist
entry was used instead of the first scatterlist entry (as was the intention
of this code).

This worked fine until the kzalloc of the sglist was replaced with kmalloc
and sg_init_table only zeroed the exact needed length. Apparently kzalloc
zeroes a bit more than is strictly necessary so the offset field was
always 0 in the past.

But now the offset field was suddenly random and this led to broken captures.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/common/saa7146_video.c