diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-01 18:24:15 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-01 18:24:15 -0300 |
commit | 2006ab389f819c535db3a5215d7feeaf6bceed18 (patch) | |
tree | 6c3d6ece5b2b6ac0eab4a13e5d3b3967b28c1fc8 /linux | |
parent | 6ae887b1a1e62f244b6c81421adab044b3056629 (diff) | |
parent | 621b289ccfba938787bd179d47be1326f88f13a2 (diff) | |
download | mediapointer-dvb-s2-2006ab389f819c535db3a5215d7feeaf6bceed18.tar.gz mediapointer-dvb-s2-2006ab389f819c535db3a5215d7feeaf6bceed18.tar.bz2 |
merge: http://www.linuxtv.org/hg/~stoth/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bt832.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 19 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/zoran_device.c | 2 |
4 files changed, 30 insertions, 5 deletions
diff --git a/linux/drivers/media/video/bt8xx/bt832.c b/linux/drivers/media/video/bt8xx/bt832.c index d4201f8eb..4eefaba8f 100644 --- a/linux/drivers/media/video/bt8xx/bt832.c +++ b/linux/drivers/media/video/bt8xx/bt832.c @@ -108,6 +108,11 @@ int bt832_init(struct i2c_client *i2c_client_s) int rc; buf=kmalloc(65,GFP_KERNEL); + if (!buf) { + v4l_err(&t->client, + "Unable to allocate memory. Detaching.\n"); + return 0; + } bt832_hexdump(i2c_client_s,buf); if(buf[0x40] != 0x31) { @@ -250,7 +255,12 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) switch (cmd) { case BT832_HEXDUMP: { unsigned char *buf; - buf=kmalloc(65,GFP_KERNEL); + buf = kmalloc(65, GFP_KERNEL); + if (!buf) { + v4l_err(&t->client, + "Unable to allocate memory\n"); + break; + } bt832_hexdump(&t->client,buf); kfree(buf); } diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 51b4a8b59..6e9ad7290 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -3158,12 +3158,18 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop) static int bttv_g_audio(struct file *file, void *priv, struct v4l2_audio *a) { + if (unlikely(a->index)) + return -EINVAL; + strcpy(a->name, "audio"); return 0; } static int bttv_s_audio(struct file *file, void *priv, struct v4l2_audio *a) { + if (unlikely(a->index)) + return -EINVAL; + return 0; } @@ -3553,7 +3559,7 @@ static int radio_enum_input(struct file *file, void *priv, return -EINVAL; strcpy(i->name, "Radio"); - i->type = V4L2_INPUT_TYPE_TUNER; + i->type = V4L2_INPUT_TYPE_TUNER; return 0; } @@ -3561,8 +3567,11 @@ static int radio_enum_input(struct file *file, void *priv, static int radio_g_audio(struct file *file, void *priv, struct v4l2_audio *a) { - memset(a, 0, sizeof(*a)); + if (unlikely(a->index)) + return -EINVAL; + strcpy(a->name, "Radio"); + return 0; } @@ -3582,11 +3591,17 @@ static int radio_s_tuner(struct file *file, void *priv, static int radio_s_audio(struct file *file, void *priv, struct v4l2_audio *a) { + if (unlikely(a->index)) + return -EINVAL; + return 0; } static int radio_s_input(struct file *filp, void *priv, unsigned int i) { + if (unlikely(i->index)) + return -EINVAL; + return 0; } diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index dc7c628f2..b25402467 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -261,7 +261,7 @@ static struct cx88_ctrl cx8800_ctls[] = { .name = "Color killer", .minimum = 0, .maximum = 1, - .default_value = 0x0, + .default_value = 0x1, .type = V4L2_CTRL_TYPE_BOOLEAN, }, .reg = MO_INPUT_FORMAT, diff --git a/linux/drivers/media/video/zoran_device.c b/linux/drivers/media/video/zoran_device.c index ed7ab4be2..2b15fcfba 100644 --- a/linux/drivers/media/video/zoran_device.c +++ b/linux/drivers/media/video/zoran_device.c @@ -1733,7 +1733,7 @@ decoder_command (struct zoran *zr, return -EIO; if (zr->card.type == LML33 && - (cmd == DECODER_SET_NORM || DECODER_SET_INPUT)) { + (cmd == DECODER_SET_NORM || cmd == DECODER_SET_INPUT)) { int res; // Bt819 needs to reset its FIFO buffer using #FRST pin and |