From patchwork Thu Sep 4 02:36:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 4842291 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DC0729F2EC for ; Thu, 4 Sep 2014 02:37:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 172302024F for ; Thu, 4 Sep 2014 02:37:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89E3220200 for ; Thu, 4 Sep 2014 02:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757041AbaIDChB (ORCPT ); Wed, 3 Sep 2014 22:37:01 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:57680 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754957AbaIDChA (ORCPT ); Wed, 3 Sep 2014 22:37:00 -0400 Received: from dyn3-82-128-191-243.psoas.suomi.net ([82.128.191.243] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1XPMux-0004Z7-0d; Thu, 04 Sep 2014 05:36:59 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 04/37] it913x: avoid division by zero on error case Date: Thu, 4 Sep 2014 05:36:12 +0300 Message-Id: <1409798205-25645-4-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409798205-25645-1-git-send-email-crope@iki.fi> References: <1409798205-25645-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.191.243 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Error on init leaves some internal divisor zero, which causes oops later. Fix it by populating divisors even it fails. Signed-off-by: Antti Palosaari --- drivers/media/tuners/tuner_it913x.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/tuners/tuner_it913x.c b/drivers/media/tuners/tuner_it913x.c index 3265d9a..cd20c5b 100644 --- a/drivers/media/tuners/tuner_it913x.c +++ b/drivers/media/tuners/tuner_it913x.c @@ -154,6 +154,9 @@ static int it913x_init(struct dvb_frontend *fe) val = 16; break; case -ENODEV: + /* FIXME: these are just avoid divide by 0 */ + state->tun_xtal = 2000; + state->tun_fdiv = 3; return -ENODEV; case 1: default: