idr: Fix an infinite loop issue
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 5 Dec 2013 09:25:23 +0000 (10:25 +0100)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Thu, 5 Dec 2013 12:10:05 +0000 (13:10 +0100)
commit48f1ebb3911b6b20e431216a593896d0258fdba5
tree2de4304e90cda8f27fd880d1d73dcf8838fb98e8
parent1d5dd71d3a3528e2c34d873dd2861829fc612200
idr: Fix an infinite loop issue

* idr routines were doing an infinite loop when the array was full but element
  #0 was still free

* Because allocations start at 1, the low bound was not being taken account of
  in idr_find_free(), causing an infinite loop

* idr_get_new_above() couldn't allocate an id >= 1 and idr_pre_get() thought it
  didn't have to expand because id #0 was available
sys/libkern/linux_idr.c
sys/sys/idr.h