public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	linux-ide@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ata: pata_hpt37x: fix potential forever loop
Date: Thu, 2 Feb 2023 09:42:12 +0300	[thread overview]
Message-ID: <Y9tbRLRgPZb5AQ+/@kadam> (raw)
In-Reply-To: <eb44fe29-47bb-315e-c340-10918a6250f6@omp.ru>

On Wed, Feb 01, 2023 at 08:18:13PM +0300, Sergey Shtylyov wrote:
> On 2/1/23 5:59 PM, Sergey Shtylyov wrote:
> [...]
> >> This code accidentally reuses the "tries" iterator for both the inside
> >> and outside loops.  It could result in a forever loop if the "tries"
> >> variable gets reset to 0x1000 and never reaches 0x5000.
> 
>    Have you actually seen this happening?
> 

No, this is from static analysis.

drivers/ata/pata_hpt3x2n.c:390 hpt3xn_calibrate_dpll() warn: reusing outside iterator: 'tries'

You're right that this is a false positive.  I thought I had addressed
that particular type of false positive so the check wouldn't warn about
it but apparently I hadn't.  Sorry!

Thanks again for reviewing this.

regards,
dan carpenter


      reply	other threads:[~2023-02-02  6:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 14:10 [PATCH] ata: pata_hpt37x: fix potential forever loop Dan Carpenter
2023-02-01 14:59 ` Sergey Shtylyov
2023-02-01 17:18   ` Sergey Shtylyov
2023-02-02  6:42     ` Dan Carpenter [this message]

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=Y9tbRLRgPZb5AQ+/@kadam \
    --to=error27@gmail.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=s.shtylyov@omp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox