> Quoting Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: [PATCH for-2.6.22] IB/cm: improve local id allocation
> 
> lib/idr.c says it returns positive IDs always (actually the comments
> say "in the range 0 ... 0x7fffffff").  So I guess we would want
> something like:
> 
>       if (!ret)
>               next_id = id == INT_MAX ? 0 : id + 1;

True, except INT_MAX isn't defined in kernel headers I think,
so I just put 0x7fffffff there.

> (current code has a similar bug, plus exposes undefined behavior of
> signed overflow).


-- 
MST
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to