From patchwork Wed May 12 14:40:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Terjan X-Patchwork-Id: 99014 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 o4CEessH018052 for ; Wed, 12 May 2010 14:40:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751858Ab0ELOkx (ORCPT ); Wed, 12 May 2010 10:40:53 -0400 Received: from ryu.zarb.org ([212.85.158.22]:33064 "EHLO ryu.zarb.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461Ab0ELOkw (ORCPT ); Wed, 12 May 2010 10:40:52 -0400 Received: from localhost (localhost [127.0.0.1]) by ryu.zarb.org (Postfix) with ESMTP id 2E4B73FC30 for ; Wed, 12 May 2010 16:40:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at zarb.org Received: from ryu.zarb.org ([127.0.0.1]) by localhost (ryu.zarb.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id BZlBAZtbDeFY for ; Wed, 12 May 2010 16:40:50 +0200 (CEST) Received: from [192.168.100.101] (unknown [195.7.104.248]) by ryu.zarb.org (Postfix) with ESMTPSA id 036AB3FC32 for ; Wed, 12 May 2010 16:40:49 +0200 (CEST) Subject: [PATCH] [budget] Wrong code on init failure From: Pascal Terjan To: linux-media@vger.kernel.org Organization: Mandriva Date: Wed, 12 May 2010 16:40:40 +0200 Message-ID: <1273675240.20854.68.camel@plop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2-1mdv2010.1 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, 12 May 2010 14:40:54 +0000 (UTC) diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index 9fdf26c..14adf27 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c @@ -627,25 +627,26 @@ 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_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; - - 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_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; + + dvb_attach(isl6423_attach, + budget->dvb_frontend, + &budget->i2c_adap, + &tt1600_isl6423_config); + } else { + dvb_frontend_detach(budget->dvb_frontend); + budget->dvb_frontend = NULL; + } } } break;