From patchwork Thu Feb 27 15:00:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 3733901 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 25532BF13A for ; Thu, 27 Feb 2014 15:01:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 845262021A for ; Thu, 27 Feb 2014 15:01:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 931BC20203 for ; Thu, 27 Feb 2014 15:01:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbaB0PBT (ORCPT ); Thu, 27 Feb 2014 10:01:19 -0500 Received: from mout.gmx.net ([212.227.15.18]:51958 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbaB0PBS (ORCPT ); Thu, 27 Feb 2014 10:01:18 -0500 Received: from Workstation4.fritz.box ([109.91.85.119]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MTCDO-1Whks704Hu-00S9BA for ; Thu, 27 Feb 2014 16:01:17 +0100 From: xypron.glpk@gmx.de To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 1/1] Reading array out of bound in ds3000_read_snr Date: Thu, 27 Feb 2014 16:00:53 +0100 Message-Id: <1393513253-10723-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 1.7.10.4 X-Provags-ID: V03:K0:ISod6VADIDQX1vJ35Uwrfc5KRjunXLhP3juF0OiPVP2/fNnfYG7 JWoLnee1B7WT1YojdzcS6PABkdEFdEFuoYuuJOTDEEHSFuFyQzTl1uirlsNaP+uzrLQz3AW 4t7ZsYP5hm2Wy44TS9KdFu+XtnFwgGvKqk1IQN3a4DQDcDnbsfMn+C9Fszc2goa+AHrfHm2 +xHAsOgIvDSTmXw/wLGFw== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 From: Heinrich Schuchardt An attempt was made to read dvbs2_snr_tab[80], though dvbs2_snr_tab has only 80 elements. Signed-off-by: Heinrich Schuchardt --- drivers/media/dvb-frontends/ds3000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index 1e344b0..335daef 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -616,7 +616,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr) snr_reading = dvbs2_noise_reading / tmp; if (snr_reading > 80) snr_reading = 80; - *snr = -(dvbs2_snr_tab[snr_reading] / 1000); + *snr = -(dvbs2_snr_tab[snr_reading - 1] / 1000); } dprintk("%s: raw / cooked = 0x%02x / 0x%04x\n", __func__, snr_reading, *snr);