From patchwork Mon Mar 22 17:54:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Noirbent X-Patchwork-Id: 87469 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 o2MIPBCd012415 for ; Mon, 22 Mar 2010 18:26:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753534Ab0CVS0A (ORCPT ); Mon, 22 Mar 2010 14:26:00 -0400 Received: from mx.fr.smartjog.net ([91.197.165.186]:33511 "EHLO mail.dmz-ext.fr.lan" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751884Ab0CVSZ7 (ORCPT ); Mon, 22 Mar 2010 14:25:59 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Mar 2010 18:26:01 +0000 (UTC) X-Greylist: delayed 1855 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Mar 2010 14:25:59 EDT Received: from localhost (localhost [127.0.0.1]) by mail.dmz-ext.fr.lan (Postfix) with ESMTP id D341357531; Mon, 22 Mar 2010 17:55:02 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at smartjog.com Received: from mail.dmz-ext.fr.lan ([127.0.0.1]) by localhost (mail.dmz-ext.fr.lan [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dZf1ncDnjBex; Mon, 22 Mar 2010 17:55:02 +0000 (GMT) Received: from localhost.localdomain (nnoirben.user.fr.lan [192.168.0.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.dmz-ext.fr.lan (Postfix) with ESMTP id A6A8A574F1; Mon, 22 Mar 2010 17:55:02 +0000 (GMT) From: Nicolas Noirbent To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, "Igor M. Liplianin" , matthias@tevii.com, Nicolas Noirbent Subject: [PATCH] V4L/DVB: ds3000: fix divide-by-zero error in ds3000_read_snr() Date: Mon, 22 Mar 2010 18:54:43 +0100 Message-Id: <1269280483-4586-1-git-send-email-nicolas.noirbent@smartjog.com> X-Mailer: git-send-email 1.7.0.2 Organization: SmartJog S.A.S. Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c index cff3535..78001e8 100644 --- a/drivers/media/dvb/frontends/ds3000.c +++ b/drivers/media/dvb/frontends/ds3000.c @@ -719,7 +719,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr) (ds3000_readreg(state, 0x8d) << 4); dvbs2_signal_reading = ds3000_readreg(state, 0x8e); tmp = dvbs2_signal_reading * dvbs2_signal_reading >> 1; - if (dvbs2_signal_reading == 0) { + if (tmp == 0) { *snr = 0x0000; return 0; }