[ofa-general] [PATCH] ipoib: Bug fix in ipoib_poll - resend
Eli Cohen
eli at mellanox.co.il
Tue Nov 27 08:17:32 PST 2007
On Tue, 2007-11-27 at 07:32 -0800, Roland Dreier wrote:
> > > > + if (unlikely(n < 1))
> > > > + break;
> > > >
> > > > for (i = 0; i < n; i++) {
> > > > struct ib_wc *wc = priv->ibwc + i;
> >
> > > The 'for' loop (followed by the "if (n != t) break" check)
> > > should take care of this, isn't it?
> >
> > Oh you're saying that since this is signed arithmetic we should never
> > enter the for loop. I saw a problem when I worked on some patch and that
> > seemed to solve the problem...
>
> What does signed arithmetic have to do with anything? I don't see how
> your patch changes the behavior at all: if the condition (n < 1) ever
> tests as true then the for loop cannot be entered, and since t is
> always at least 1, the condition (n != t) will be true and we'll break
> out of the while loop anyway.
>
I mean that I agree that the patch does not fix anything since even if
poll_cq returns a negative number, "i < n" in the for loop will cause
the block to not be executed (since "0 < negative number" is false).
More information about the general
mailing list