All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Peter Teoh <htmldeveloper@gmail.com>
Cc: Adrian Bunk <bunk@kernel.org>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: ide_register_hw(): buggy code
Date: Tue, 4 Mar 2008 21:57:22 +0100	[thread overview]
Message-ID: <200803042157.23592.bzolnier@gmail.com> (raw)
In-Reply-To: <804dabb00803031701g368a7082q248cc2b05e762fa1@mail.gmail.com>

On Tuesday 04 March 2008, Peter Teoh wrote:
> On Tue, Mar 4, 2008 at 6:29 AM, Bartlomiej Zolnierkiewicz
> <bzolnier@gmail.com> wrote:
> >
> >  Hi,
> >
> >
> >  On Monday 03 March 2008, Peter Teoh wrote:
> >  > On Sun, Mar 2, 2008 at 11:19 PM, Adrian Bunk <bunk@kernel.org> wrote:
> >  > > The Coverity checker spotted the following bogus change to
> >  > >  ide_register_hw() in commit 9e016a719209d95338e314b46c3012cc7feaaeec:
> >  > >
> >  > >  <--  snip  -->
> >  > >
> >  > >  ...
> >  > >  +               hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]);
> >  > >  +               index = hwif->index;
> >  > >  +               if (hwif)
> >  > >  +                       goto found;
> >  > >                 for (index = 0; index < MAX_HWIFS; index++)
> >  > >  ...
> >  > >
> >  > >  <--  snip  -->
> >  > >
> >  > >  It's impossible to reach the for() loop without Oopsing before.
> >
> >  [ iff free hwif is not found (unlikely case) ]
> >
> >
> >  > >  Can you either fix this for 2.6.25 or push your patch that removes
> >  > >  ide_register_hw() for 2.6.25?
> >  > >
> >  >
> >  > My question is:
> >  >
> >  > a.   why is "retry=1", and then the do while loop always end up the
> >  > loop being one round executed only?   Why not just remove the while
> >  > loop entirely?
> >
> >  the whole ide_register_hw() is already gone in IDE tree
> >  (these patches are scheduled for 2.6.26)
> >
> >
> >  > b.   not sure if your statement above implied this, but checking for
> >  > hwif!=0 should be before index.  ???
> >  >
> >  > c.   "index = hwif->index;" should not be there, but after "found".
> >  > Is that correct?
> >
> >  Yes, could you please re-do your patch to contain:
> >
> >  - only 'hwif->index' change
> >  - proper patch description
> >  - Signed-off-by: line
> >
> >  so I could merge it?
> 
> 
> Description:
> 
> Relocating the index to come after finding the hwif pointer.

applied, thanks

      reply	other threads:[~2008-03-04 21:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02 15:19 ide_register_hw(): buggy code Adrian Bunk
2008-03-03 16:03 ` Peter Teoh
2008-03-03 22:29   ` Bartlomiej Zolnierkiewicz
2008-03-04  1:01     ` Peter Teoh
2008-03-04 20:57       ` Bartlomiej Zolnierkiewicz [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=200803042157.23592.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=bunk@kernel.org \
    --cc=htmldeveloper@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.