From patchwork Wed Mar 24 13:30:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 87921 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2ODUN0Z031819 for ; Wed, 24 Mar 2010 13:30:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756198Ab0CXNaV (ORCPT ); Wed, 24 Mar 2010 09:30:21 -0400 Received: from canardo.mork.no ([148.122.252.1]:45413 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755863Ab0CXNaV (ORCPT ); Wed, 24 Mar 2010 09:30:21 -0400 Received: from canardo.mork.no (ip6-localhost [IPv6:::1]) by canardo.mork.no (8.14.3/8.14.3) with ESMTP id o2ODUFkS021788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Mar 2010 14:30:15 +0100 Received: (from bjorn@localhost) by canardo.mork.no (8.14.3/8.14.3/Submit) id o2ODUFV7021787; Wed, 24 Mar 2010 14:30:15 +0100 From: =?utf-8?q?Bj=C3=B8rn=20Mork?= To: linux-media@vger.kernel.org Cc: =?utf-8?q?Bj=C3=B8rn=20Mork?= Subject: [PATCH v2 for v4l-dvb master] V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference" Date: Wed, 24 Mar 2010 14:30:15 +0100 Message-Id: <1269437415-21761-1-git-send-email-bjorn@mork.no> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 References: <1269428277-6709-1-git-send-email-bjorn@mork.no> <201003241325.52864@orion.escape-edv.de> <1269436658-20370-1-git-send-email-bjorn@mork.no> In-Reply-To: <1269436658-20370-1-git-send-email-bjorn@mork.no> X-Spam-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_00, DATE_IN_FUTURE_48_96,NO_RELAYS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on canardo.mork.no X-Virus-Scanned: clamav-milter 0.95.3 at canardo X-Virus-Status: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 24 Mar 2010 13:30:23 +0000 (UTC) diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index fccb6ad..918679e 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c @@ -628,32 +628,36 @@ static void frontend_init(struct budget *budget) &tt1600_stv6110x_config, &budget->i2c_adap); - tt1600_stv090x_config.tuner_init = ctl->tuner_init; - tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; - tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; - tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; - tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; - tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; - tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; - tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; - tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; - tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; - tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; - - /* call the init function once to initialize - tuner's clock output divider and demod's - master clock */ - if (budget->dvb_frontend->ops.init) - budget->dvb_frontend->ops.init(budget->dvb_frontend); - - dvb_attach(isl6423_attach, - budget->dvb_frontend, - &budget->i2c_adap, - &tt1600_isl6423_config); - - } else { - dvb_frontend_detach(budget->dvb_frontend); - budget->dvb_frontend = NULL; + if (ctl) { + tt1600_stv090x_config.tuner_init = ctl->tuner_init; + tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; + tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; + tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; + tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; + tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; + tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; + tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; + tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; + tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; + tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; + + /* call the init function once to initialize + tuner's clock output divider and demod's + master clock */ + if (budget->dvb_frontend->ops.init) + budget->dvb_frontend->ops.init(budget->dvb_frontend); + + if (dvb_attach(isl6423_attach, + budget->dvb_frontend, + &budget->i2c_adap, + &tt1600_isl6423_config) == NULL) { + printk("%s: No Intersil ISL6423 found!\n", __func__); + goto error_out; + } + } else { + printk("%s: No STV6110(A) Silicon Tuner found!\n", __func__); + goto error_out; + } } } break;