From 4a8f3a5727c589a59bcaaca43dc1025b347b7a75 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 1 Apr 2008 16:48:23 -0300 Subject: [PATCH 1/3] V4L/DVB (7460): bttv: Bt832 - fix possible NULL pointer deref This patch does fix potential NULL pointer dereference Signed-off-by: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bt832.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/bt8xx/bt832.c b/drivers/media/video/bt8xx/bt832.c index a51876137880..f92f06dec0d0 100644 --- a/drivers/media/video/bt8xx/bt832.c +++ b/drivers/media/video/bt8xx/bt832.c @@ -97,6 +97,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) { @@ -211,7 +216,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); } From 8e08af3c30b4e5f59adff0baa33fd346227b45e2 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Wed, 2 Apr 2008 22:14:41 -0300 Subject: [PATCH 2/3] V4L/DVB (7495): s5h1409: fix blown-away bit in function s5h1409_set_gpio Preserve all other bits when setting gpio. Signed-off-by: Michael Krufky Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/s5h1409.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c index 819433485d3b..1a4d8319773c 100644 --- a/drivers/media/dvb/frontends/s5h1409.c +++ b/drivers/media/dvb/frontends/s5h1409.c @@ -445,7 +445,7 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable) s5h1409_readreg(state, 0xe3) | 0x1100); else return s5h1409_writereg(state, 0xe3, - s5h1409_readreg(state, 0xe3) & 0xeeff); + s5h1409_readreg(state, 0xe3) & 0xfeff); } static int s5h1409_sleep(struct dvb_frontend* fe, int enable) From a80c5aa6da485da63def31442a19cdd6ff495ce6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 3 Apr 2008 20:08:04 -0300 Subject: [PATCH 3/3] V4L/DVB (7499): v4l/dvb Kconfig: Fix bugzilla #10067 tda8290 breaks if tuner is selected, but CONFIG_DVB=n. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/Makefile b/drivers/media/Makefile index 8cf91353b56a..7b8bb6949f5e 100644 --- a/drivers/media/Makefile +++ b/drivers/media/Makefile @@ -6,3 +6,6 @@ obj-y := common/ obj-y += video/ obj-$(CONFIG_VIDEO_DEV) += radio/ obj-$(CONFIG_DVB_CORE) += dvb/ +ifeq ($(CONFIG_DVB_CORE),) + obj-$(CONFIG_VIDEO_TUNER) += dvb/frontends/ +endif