diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-27 19:08:54 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-27 19:08:54 +0200 |
commit | 89e2fea073c15a3f72ec74c3859e7a3b271e7db3 (patch) | |
tree | 158c71d7be6ea8eb265910d5785902c4552907c3 /linux | |
parent | a2f7e7dbf0f5aeb8842ac6c3e9acd151180d1975 (diff) | |
download | mediapointer-dvb-s2-89e2fea073c15a3f72ec74c3859e7a3b271e7db3.tar.gz mediapointer-dvb-s2-89e2fea073c15a3f72ec74c3859e7a3b271e7db3.tar.bz2 |
saa7146: fix read from uninitialized memory
From: Hans Verkuil <hverkuil@xs4all.nl>
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>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index a2333bff8..1c22c39c2 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -657,7 +657,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu /* if we have a user buffer, the first page may not be aligned to a page boundary. */ - pt1->offset = list->offset; + pt1->offset = dma->sglist->offset; pt2->offset = pt1->offset+o1; pt3->offset = pt1->offset+o2; |