From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9712CC83F10 for ; Thu, 31 Aug 2023 14:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236458AbjHaOZ1 (ORCPT ); Thu, 31 Aug 2023 10:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbjHaOZ1 (ORCPT ); Thu, 31 Aug 2023 10:25:27 -0400 Received: from mail.confident.ru (mail.confident.ru [85.114.29.218]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A5CECF; Thu, 31 Aug 2023 07:25:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.confident.ru (Postfix) with ESMTP id 1F2FC3FC11FA; Thu, 31 Aug 2023 17:25:19 +0300 (MSK) X-Virus-Scanned: amavisd-new at mail.confident.ru DKIM-Filter: OpenDKIM Filter v2.10.3 mail.confident.ru CF2623FC1229 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=confident.ru; s=54152002-4729-11E9-BD92-62EA33CD6873; t=1693491918; bh=byOPYdxPcvNp2QIzjeg02VM5kg3iF7RgVc2ncBv29xE=; h=Date:From:To:Message-ID; b=UV3p8BG8YLvf3RuU0wyMYGZ08GpAXcYl6oEDpWM3AalQ4X5aZMw/0K7nWEjj+avNV IzwEBlua6JaTk09O+pj2ODFMVzlJk9AEwYOrBoxkO6vltV4soD/h3l5lg9zA1jsdip g0k8PF9uzzmKEDNrbm+hB4+ibojNdZHDV6nx/i1f+vSgSzqSWzZx6BoKrT2BBYq8IL wNhwrovOye1Tt45RIHqQpDLh7hfuW3emEklrWtM3XahdB+L/0I8tcFfeAA04/4r4Gu ta0Wkrl3x9PadjugzwuawBckaQiimSUk1XHSUUpnbt3fkWymHhecxNYIRYm8TtKUDI TNW8IN1Rd8+Qw== Date: Thu, 31 Aug 2023 17:25:18 +0300 (MSK) From: =?utf-8?B?0KDQsNC90LQg0JTQtdC10LE=?= To: Krzysztof Kozlowski , Michael Buesch , linux-wireless , linux-kernel Cc: lvc-project , =?utf-8?B?0JLQvtGB0LrRgNC10YHQtdC90YHQutC40Lkg0KHRgtCw0L3QuNGB0LvQsNCyINCY0LPQvtGA0LXQstC40Yc=?= Message-ID: <763366419.1280837.1693491918477.JavaMail.zimbra@confident.ru> In-Reply-To: References: <20230830082759.23336-1-deeb.rand@confident.ru> Subject: Re: [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate() Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thread-Topic: ssb-main: Fix division by zero in ssb_calc_clock_rate() Thread-Index: 3oX7rNxnF1lDTiTKvuHauk/peINrWw== Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Dear Krzysztof, Thank you for your response, now I see, but we already used the standard=20 tool git send-email to send the patch. It seems we have to set the=20 transfer-encoding manually (not default), we will fix it next time. It's our first time trying to send a patch. Best Regards, Rand ----- Original Message ----- From: "Krzysztof Kozlowski" To: "Rand Deeb" , "Michael Buesch" , "li= nux-wireless" , "linux-kernel" Cc: "lvc-project" , "=D0=92=D0=BE=D1=81=D0=BA= =D1=80=D0=B5=D1=81=D0=B5=D0=BD=D1=81=D0=BA=D0=B8=D0=B9 =D0=A1=D1=82=D0=B0= =D0=BD=D0=B8=D1=81=D0=BB=D0=B0=D0=B2 =D0=98=D0=B3=D0=BE=D1=80=D0=B5=D0=B2= =D0=B8=D1=87" Sent: Thursday, August 31, 2023 4:45:15 PM Subject: Re: [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate(= ) On 30/08/2023 10:27, Rand Deeb wrote: > In ssb_calc_clock_rate(), the value of m1 may be zero because it is > initialized using clkfactor_f6_resolv(). This function could return > zero, so there is a possibility of dividing by zero, we fixed it by > checking the values before dividing. >=20 > Found by Linux Verification Center (linuxtesting.org) with SVACE. Version your patches and provide changelog after --- . >=20 > Signed-off-by: Rand Deeb > --- > drivers/ssb/main.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c > index 0a26984acb2c..e0776a16d04d 100644 > --- a/drivers/ssb/main.c > +++ b/drivers/ssb/main.c > @@ -903,13 +903,21 @@ u32 ssb_calc_clock_rate(u32 plltype, u32 n, u32 m) > =09=09case SSB_CHIPCO_CLK_MC_BYPASS: > =09=09=09return clock; > =09=09case SSB_CHIPCO_CLK_MC_M1: > -=09=09=09return (clock / m1); > +=09=09=09if (m1 !=3D3D 0) Nothing improved here. Don't send patches as quoted-printable via some weird mailers. Recommendation is to use standard tool - git send-email. As you can easily see on the web - it is re-formatted for quoted-printable: https://lore.kernel.org/all/20230830082759.23336-1-deeb.rand@confident.ru/r= aw Best regards, Krzysztof