summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-simple.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-02-24 21:35:59 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-02-24 21:35:59 -0300
commit9640ff21c81761b4f6e6c997fda71717a20bb885 (patch)
treeb0cf6b1b6b79e0d3b11a46d1b9425db4180d4c25 /linux/drivers/media/video/tuner-simple.c
parentb8fc485e6b70590178b108ef66e954d175c322fe (diff)
downloadmediapointer-dvb-s2-9640ff21c81761b4f6e6c997fda71717a20bb885.tar.gz
mediapointer-dvb-s2-9640ff21c81761b4f6e6c997fda71717a20bb885.tar.bz2
From: Mauro Carvalho Chehab <mchehab@infradead.org>
simple_set_tv() creates a buffer with 4 elements, and calls simple_std_setup(), passing &buffer[1]. This makes the 5th element of buffer to be initialized to 0, overriding some area outside the buffer. Also, simple_std_setup() receives a buffer as parameter, but the buffer is just overriden after the call, so, it doesn't make much sense to pass it as a parameter. This patch removes buffer[] from the function call, creating, instead, a local var to be used internally. Thanks to Axel Rometsch <axel.rometsch@freenet.de> for pointing the issue. Reviewed-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/tuner-simple.c')
-rw-r--r--linux/drivers/media/video/tuner-simple.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index 24f63945d..496424fc4 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -265,7 +265,7 @@ static int simple_config_lookup(struct dvb_frontend *fe,
static int simple_std_setup(struct dvb_frontend *fe,
struct analog_parameters *params,
- u8 *buffer, u8 *config, u8 *cb)
+ u8 *config, u8 *cb)
{
struct tuner_simple_priv *priv = fe->tuner_priv;
u8 tuneraddr;
@@ -337,14 +337,12 @@ static int simple_std_setup(struct dvb_frontend *fe,
break;
case TUNER_PHILIPS_TUV1236D:
+ {
/* 0x40 -> ATSC antenna input 1 */
/* 0x48 -> ATSC antenna input 2 */
/* 0x00 -> NTSC antenna input 1 */
/* 0x08 -> NTSC antenna input 2 */
- buffer[0] = 0x14;
- buffer[1] = 0x00;
- buffer[2] = 0x17;
- buffer[3] = 0x00;
+ u8 buffer[4] = { 0x14, 0x00, 0x17, 0x00};
*cb &= ~0x40;
if (params->std & V4L2_STD_ATSC) {
*cb |= 0x40;
@@ -365,6 +363,7 @@ static int simple_std_setup(struct dvb_frontend *fe,
/* FIXME: input */
break;
}
+ }
return 0;
}
@@ -536,7 +535,7 @@ static int simple_set_tv_freq(struct dvb_frontend *fe,
offset / 16, offset % 16 * 100 / 16, div);
/* tv norm specific stuff for multi-norm tuners */
- simple_std_setup(fe, params, &buffer[1], &config, &cb);
+ simple_std_setup(fe, params, &config, &cb);
if (t_params->cb_first_if_lower_freq && div < priv->last_div) {
buffer[0] = config;