[ofa-general] Re: [PATCH for-2.6.22] IB/cm: improve local id allocation

Roland Dreier rdreier at cisco.com
Mon May 21 09:01:28 PDT 2007


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.



More information about the general mailing list