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;

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

 - R.
_______________________________________________
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