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
a582a9a0fe
commit
90487f1be9
@ -223,7 +223,7 @@ idr_pre_get(struct idr *idr, gfp_t gfp_mask)
|
|||||||
for (il = idr->free; il != NULL; il = il->ary[0])
|
for (il = idr->free; il != NULL; il = il->ary[0])
|
||||||
need--;
|
need--;
|
||||||
mtx_unlock(&idr->lock);
|
mtx_unlock(&idr->lock);
|
||||||
if (need == 0)
|
if (need <= 0)
|
||||||
break;
|
break;
|
||||||
for (head = NULL; need; need--) {
|
for (head = NULL; need; need--) {
|
||||||
iln = malloc(sizeof(*il), M_IDR, M_ZERO | gfp_mask);
|
iln = malloc(sizeof(*il), M_IDR, M_ZERO | gfp_mask);
|
||||||
|
Loading…
Reference in New Issue
Block a user