aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2010-03-24 09:30:15 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:17 -0400
commitdd0bbcc626d8baa6821c6cb9c45ecf3759ef8088 (patch)
tree8cb1abe3267e5d150adcb657baaf4272439551f2 /drivers
parent784a493168f71ce02b5f9eab0ec19df29b999631 (diff)
V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference"
Never call dvb_frontend_detach if we failed to attach a frontend. This fixes the following oops: [ 8.172997] DVB: registering new adapter (TT-Budget S2-1600 PCI) [ 8.209018] adapter has MAC addr = 00:d0:5c:cc:a7:29 [ 8.328665] Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17 [ 8.328753] Intel ICH 0000:00:1f.5: setting latency timer to 64 [ 8.562047] DVB: Unable to find symbol stv090x_attach() [ 8.562117] BUG: unable to handle kernel NULL pointer dereference at 000000ac [ 8.562239] IP: [<e08b04a3>] dvb_frontend_detach+0x4/0x67 [dvb_core] Ref http://bugs.debian.org/575207 Also clean up if we are unable to register the tuner and LNB drivers [mchehab@redhat.com: add printk log level, to calm down chechpatch.pl] Signed-off-by: Bjørn Mork <bjorn@mork.no> Reported-by: Fladischer Michael <FladischerMichael@fladi.at> Acked-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/ttpci/budget.c53
1 files changed, 30 insertions, 23 deletions
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index f5db13d8b990..874a10a9d493 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -628,29 +628,36 @@ static void frontend_init(struct budget *budget)
628 &tt1600_stv6110x_config, 628 &tt1600_stv6110x_config,
629 &budget->i2c_adap); 629 &budget->i2c_adap);
630 630
631 tt1600_stv090x_config.tuner_init = ctl->tuner_init; 631 if (ctl) {
632 tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; 632 tt1600_stv090x_config.tuner_init = ctl->tuner_init;
633 tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; 633 tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep;
634 tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; 634 tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode;
635 tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; 635 tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency;
636 tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; 636 tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency;
637 tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; 637 tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth;
638 tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; 638 tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth;
639 tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; 639 tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain;
640 tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; 640 tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain;
641 tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; 641 tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk;
642 642 tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status;
643 /* call the init function once to initialize 643
644 tuner's clock output divider and demod's 644 /* call the init function once to initialize
645 master clock */ 645 tuner's clock output divider and demod's
646 if (budget->dvb_frontend->ops.init) 646 master clock */
647 budget->dvb_frontend->ops.init(budget->dvb_frontend); 647 if (budget->dvb_frontend->ops.init)
648 648 budget->dvb_frontend->ops.init(budget->dvb_frontend);
649 dvb_attach(isl6423_attach, 649
650 budget->dvb_frontend, 650 if (dvb_attach(isl6423_attach,
651 &budget->i2c_adap, 651 budget->dvb_frontend,
652 &tt1600_isl6423_config); 652 &budget->i2c_adap,
653 653 &tt1600_isl6423_config) == NULL) {
654 printk(KERN_ERR "%s: No Intersil ISL6423 found!\n", __func__);
655 goto error_out;
656 }
657 } else {
658 printk(KERN_ERR "%s: No STV6110(A) Silicon Tuner found!\n", __func__);
659 goto error_out;
660 }
654 } 661 }
655 } 662 }
656 break; 663 break;