All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ранд Дееб" <deeb.rand@confident.ru>
To: Krzysztof Kozlowski <krzk@kernel.org>, Michael Buesch <m@bues.ch>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: lvc-project <lvc-project@linuxtesting.org>,
	"Воскресенский Станислав Игоревич"
	<voskresenski.stanislav@confident.ru>
Subject: Re: [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate()
Date: Thu, 31 Aug 2023 17:25:18 +0300 (MSK)	[thread overview]
Message-ID: <763366419.1280837.1693491918477.JavaMail.zimbra@confident.ru> (raw)
In-Reply-To: <ac040329-25a9-121b-b2b4-843b6a8d2a29@kernel.org>

Dear Krzysztof,

Thank you for your response, now I see, but we already used the standard 
tool git send-email to send the patch. It seems we have to set the 
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" <krzk@kernel.org>
To: "Rand Deeb" <deeb.rand@confident.ru>, "Michael Buesch" <m@bues.ch>, "linux-wireless" <linux-wireless@vger.kernel.org>, "linux-kernel" <linux-kernel@vger.kernel.org>
Cc: "lvc-project" <lvc-project@linuxtesting.org>, "Воскресенский Станислав Игоревич" <voskresenski.stanislav@confident.ru>
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.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

Version your patches and provide changelog after --- .

> 
> Signed-off-by: Rand Deeb <deeb.rand@confident.ru>
> ---
>  drivers/ssb/main.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> 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)
>  		case SSB_CHIPCO_CLK_MC_BYPASS:
>  			return clock;
>  		case SSB_CHIPCO_CLK_MC_M1:
> -			return (clock / m1);
> +			if (m1 !=3D 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/raw

Best regards,
Krzysztof

  reply	other threads:[~2023-08-31 14:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  8:27 [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate() Rand Deeb
2023-08-30 19:50 ` Larry Finger
2023-08-30 20:37   ` Michael Büsch
2023-08-31  7:07   ` Ранд Дееб
2023-08-31 13:46     ` Krzysztof Kozlowski
2023-08-31 15:35       ` Ранд Дееб
2023-08-31 16:05     ` Michael Büsch
2023-08-31 17:59       ` Larry Finger
2023-08-31 13:47   ` Krzysztof Kozlowski
2023-08-31 13:45 ` Krzysztof Kozlowski
2023-08-31 14:25   ` Ранд Дееб [this message]
2023-08-31 14:53     ` Krzysztof Kozlowski
  -- strict thread matches above, loose matches on Subject: below --
2023-08-29 11:12 Rand Deeb
2023-08-29 17:35 ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=763366419.1280837.1693491918477.JavaMail.zimbra@confident.ru \
    --to=deeb.rand@confident.ru \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=m@bues.ch \
    --cc=voskresenski.stanislav@confident.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.