Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1116446rwl; Fri, 24 Mar 2023 06:33:42 -0700 (PDT) X-Google-Smtp-Source: AK7set/jXIDSDIhHaraGKhw6Bky8EZ0kKY9D4hjU+aYxHi3mbQ6xwqEkXqcRymkbh88/gvUvjKnZ X-Received: by 2002:a05:6a20:8b82:b0:d9:7fcf:1076 with SMTP id m2-20020a056a208b8200b000d97fcf1076mr3331310pzh.25.1679664821809; Fri, 24 Mar 2023 06:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679664821; cv=none; d=google.com; s=arc-20160816; b=0+lfWfGw7YDGGy45N+sqBsD/NBMsKJpAh88M+Cpm9QYVf66O4oTcjj7JENsrzaePpW hEaaXijwHds3KG5JpOuyqV1PNeocvjWXy/BLHrwht1ekthQw5SEdBRHb29nm50Z15N4k inc9Pu5bQevsapP+JQbYrucxgXdqm+El7oFJtlhBMn5iJPR13unFvAa+kqtUozwiyHou 3XO/WIXvnoBRRA2ZML/c86KLuyqJWGv4oxBn7ENUX+//mxiQg02yyaS5y/z2Ib8SVSi8 BGqNNBE/l5S50ZM7doPMnwiRLuVHF4bwChwCfOKDV2zR0fPFxNPfKFKrzyozMK4H8wRE pCWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=w1Fz0CpPkZBpYkUPAqnnC5V0OL7PzWDw8KNUJKirq5A=; b=ABtH8kT5awhupOvpZBUoEH2wLJrCpN8/BL1oKCUVk4K55ES7FC6xE9k1LDj3taOtCH bGQ477r0F4zy/tgR6YKrJLhVwPhW73zn28x48/rtdM9FawdcIyMTSiBnMNWrErbcrtE3 nMKQAaznYSIGXbu4TmlpS7OLPyz+jGmc+toW0sL2r1kOa+6ffMFmaEEiVQHzpu1BrNIp g7YigzYBNZZUftvSKKEXmuozBdxjp0U+v+ZKDyVBJjMqBHUiO7lQBeVjzIDHVcxNyJc+ J0eo3K76ZW5hz+zlsRoywzn9aGiCnungfaZqqs9A7BZ3bp4CCSntq8j1Y8b3Sh7cc02U Y/dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a631753000000b0050bfa82c245si20640016pgx.855.2023.03.24.06.33.29; Fri, 24 Mar 2023 06:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232065AbjCXN0a convert rfc822-to-8bit (ORCPT + 99 others); Fri, 24 Mar 2023 09:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230426AbjCXN0S (ORCPT ); Fri, 24 Mar 2023 09:26:18 -0400 X-Greylist: delayed 822 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 24 Mar 2023 06:26:15 PDT Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C06512BD7; Fri, 24 Mar 2023 06:26:15 -0700 (PDT) From: Daniil Dulov To: Vladimir Oltean CC: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Kurt Kanzenbach , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lvc-patches@linuxtesting.org" Subject: RE: [PATCH] media: dib7000p: Fix potential division by zero Thread-Topic: [PATCH] media: dib7000p: Fix potential division by zero Thread-Index: AQHZXlJCahOtyHS28k6Qw/NYufpjpK8JtkWAgAAy2hA= Date: Fri, 24 Mar 2023 13:26:13 +0000 Message-ID: <2953a53dd08247ca8b762cc9d3782c81@aladdin.ru> References: <20230324131209.651475-1-d.dulov@aladdin.ru> <20230324131445.g42kvq5wzj2z3qil@skbuf> In-Reply-To: <20230324131445.g42kvq5wzj2z3qil@skbuf> Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.0.20.32] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Vladimir, Sorry, I used a script with a wrong module, my fault. -----Original Message----- From: Vladimir Oltean [mailto:olteanv@gmail.com] Sent: Friday, March 24, 2023 4:15 PM To: Daniil Dulov Cc: Andrew Lunn ; Vivien Didelot ; Florian Fainelli ; David S. Miller ; Jakub Kicinski ; Kurt Kanzenbach ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; lvc-patches@linuxtesting.org Subject: Re: [PATCH] media: dib7000p: Fix potential division by zero Hi Daniil, On Fri, Mar 24, 2023 at 06:12:09AM -0700, Daniil Dulov wrote: > Variable loopdiv can be assigned 0, then it is used as a denominator, > without checking it for 0. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 713d54a8bd81 ("[media] DiB7090: add support for the dib7090 > based") > Signed-off-by: Daniil Dulov > --- > drivers/media/dvb-frontends/dib7000p.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/dvb-frontends/dib7000p.c > b/drivers/media/dvb-frontends/dib7000p.c > index 55bee50aa871..bea5717907e7 100644 > --- a/drivers/media/dvb-frontends/dib7000p.c > +++ b/drivers/media/dvb-frontends/dib7000p.c > @@ -497,7 +497,7 @@ static int dib7000p_update_pll(struct dvb_frontend *fe, struct dibx000_bandwidth > prediv = reg_1856 & 0x3f; > loopdiv = (reg_1856 >> 6) & 0x3f; > > - if ((bw != NULL) && (bw->pll_prediv != prediv || bw->pll_ratio != loopdiv)) { > + if (loopdiv && (bw != NULL) && (bw->pll_prediv != prediv || > +bw->pll_ratio != loopdiv)) { > dprintk("Updating pll (prediv: old = %d new = %d ; loopdiv : old = %d new = %d)\n", prediv, bw->pll_prediv, loopdiv, bw->pll_ratio); > reg_1856 &= 0xf000; > reg_1857 = dib7000p_read_word(state, 1857); > -- > 2.25.1 > Did you send this patch to the correct recipients and mailing lists? $ ./scripts/get_maintainer.pl drivers/media/dvb-frontends/dib7000p.c Mauro Carvalho Chehab (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)) linux-media@vger.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)) linux-kernel@vger.kernel.org (open list)