Fix bug in idr_pre_get where it doesn't handle 'need' correctly.
Obtained from: Chelsio Communications' internal repository.
This commit is contained in:
parent
681c32931f
commit
9d3c01e391
@ -223,7 +223,7 @@ idr_pre_get(struct idr *idr, gfp_t gfp_mask)
|
||||
for (il = idr->free; il != NULL; il = il->ary[0])
|
||||
need--;
|
||||
mtx_unlock(&idr->lock);
|
||||
if (need == 0)
|
||||
if (need <= 0)
|
||||
break;
|
||||
for (head = NULL; need; need--) {
|
||||
iln = malloc(sizeof(*il), M_IDR, M_ZERO | gfp_mask);
|
||||
|
Loading…
Reference in New Issue
Block a user