git: idr: Fix an infinite loop issue

Francois Tigeot ftigeot at crater.dragonflybsd.org
Thu Dec 5 04:27:54 PST 2013


commit 48f1ebb3911b6b20e431216a593896d0258fdba5
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Dec 5 10:25:23 2013 +0100

    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

Summary of changes:
 sys/libkern/linux_idr.c | 308 +++++++++++++++++++++++++++++++-----------------
 sys/sys/idr.h           |   3 +-
 2 files changed, 201 insertions(+), 110 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/48f1ebb3911b6b20e431216a593896d0258fdba5


-- 
DragonFly BSD source repository


More information about the Commits mailing list