From 8a7929e609867aef708084c722c83c110a4d396a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 27 Mar 2008 23:51:05 +0000 Subject: Test cmd, not definition in decoder_command(), drivers/media/video/zoran_device.c From: Roel Kluin <12o3l@tiscali.nl> include/linux/video_decoder.h: 34:#define DECODER_SET_NORM _IOW('d', 3, int) 35:#define DECODER_SET_INPUT _IOW('d', 4, int) untested, please confirm it's right. Test cmd value, not definition of DECODER_SET_INPUT Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/zoran_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux') 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 -- cgit v1.2.3 From dacccb05d56ba22e51620a78a36a74ee1c96b5f4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 1 Apr 2008 16:48:23 +0000 Subject: bttv: Bt832 - fix possible NULL pointer deref From: Cyrill Gorcunov This patch does fix potential NULL pointer dereference Signed-off-by: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/bt8xx/bt832.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'linux') 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); } -- cgit v1.2.3 From 6b8e1941619bd16379eac9563643a370c2e8c5d6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 1 Apr 2008 17:49:13 +0000 Subject: bttv: fix missed index check From: Cyrill Gorcunov We should check for proper index first Signed-off-by: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/bt8xx/bttv-driver.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 51b4a8b59..8c733bf59 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -3561,8 +3561,12 @@ static int radio_enum_input(struct file *file, void *priv, static int radio_g_audio(struct file *file, void *priv, struct v4l2_audio *a) { + if (a->index != 0) + return -EINVAL; + memset(a, 0, sizeof(*a)); strcpy(a->name, "Radio"); + return 0; } -- cgit v1.2.3 From 78d8c9381f9d8afcbaffe5c8f647554a05e9425a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 1 Apr 2008 17:30:24 -0300 Subject: bttv: Fix some API non-compliances for some audio/input V4L2 calls From: Mauro Carvalho Chehab Thanks to Cyrill Gorcunov for pointing this CC: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/bt8xx/bttv-driver.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 8c733bf59..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,10 +3567,9 @@ static int radio_enum_input(struct file *file, void *priv, static int radio_g_audio(struct file *file, void *priv, struct v4l2_audio *a) { - if (a->index != 0) + if (unlikely(a->index)) return -EINVAL; - memset(a, 0, sizeof(*a)); strcpy(a->name, "Radio"); return 0; @@ -3586,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; } -- cgit v1.2.3 From 621b289ccfba938787bd179d47be1326f88f13a2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 23 Mar 2008 22:43:25 +0000 Subject: cx88: Enable color killer by default From: Frej Drejhammar An enabled color killer will not degrade picture quality for color input signals, only suppress bogus color information on black-and-white input. Therefore enable it by default. Signed-off-by: Frej Drejhammar Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cx88/cx88-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux') 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, -- cgit v1.2.3