diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-30 12:29:57 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-30 12:29:57 -0300 |
commit | 9373e8ec30bbe4d744b333b537d7c24984e875d4 (patch) | |
tree | 0e0f2d7e1c41f06fc09e25fcd662e0efd035270a | |
parent | efd1d28ceb71781028852d02ac5f1c860408d2d9 (diff) | |
download | mediapointer-dvb-s2-9373e8ec30bbe4d744b333b537d7c24984e875d4.tar.gz mediapointer-dvb-s2-9373e8ec30bbe4d744b333b537d7c24984e875d4.tar.bz2 |
tuner: Failures at tuner_attach were producing OOPS
From: Mauro Carvalho Chehab <mchehab@infradead.org>
As reported by Mike Galbraith <efault@gmx.de>:
[ 13.666587] TUNER: Unable to find symbol tda829x_probe()
[ 13.674638] tuner' 1-004b: chip found @ 0x96 (saa7133[0])
[ 13.691175] DVB: Unable to find symbol tda9887_attach()
[ 13.698968] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[ 13.709509] IP: [<ffffffff80302934>] strlcpy+0x11/0x36
[ 13.711135] PGD be167067 PUD be140067 PMD 0
[ 13.711137] Oops: 0000 [1] SMP
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | linux/drivers/media/video/tuner-core.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index 3902d6a1f..818fa7008 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -369,16 +369,6 @@ static void tuner_i2c_address_check(struct tuner *t) tuner_warn("====================== WARNING! ======================\n"); } -static void attach_tda829x(struct tuner *t) -{ - struct tda829x_config cfg = { - .lna_cfg = t->config, - .tuner_callback = t->tuner_callback, - }; - dvb_attach(tda829x_attach, - &t->fe, t->i2c->adapter, t->i2c->addr, &cfg); -} - static struct xc5000_config xc5000_cfg; static void set_type(struct i2c_client *c, unsigned int type, @@ -414,12 +404,19 @@ static void set_type(struct i2c_client *c, unsigned int type, switch (t->type) { case TUNER_MT2032: - dvb_attach(microtune_attach, - &t->fe, t->i2c->adapter, t->i2c->addr); + if (!dvb_attach(microtune_attach, + &t->fe, t->i2c->adapter, t->i2c->addr)) + goto attach_failed; break; case TUNER_PHILIPS_TDA8290: { - attach_tda829x(t); + struct tda829x_config cfg = { + .lna_cfg = t->config, + .tuner_callback = t->tuner_callback, + }; + if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter, + t->i2c->addr, &cfg)) + goto attach_failed; break; } case TUNER_TEA5767: @@ -470,8 +467,9 @@ static void set_type(struct i2c_client *c, unsigned int type, break; } case TUNER_TDA9887: - dvb_attach(tda9887_attach, - &t->fe, t->i2c->adapter, t->i2c->addr); + if (!dvb_attach(tda9887_attach, + &t->fe, t->i2c->adapter, t->i2c->addr)) + goto attach_failed; break; case TUNER_XC5000: { |