kernel: umem: fix use of uninitialized fptr in freelist_pop

CID 156230 (#1 of 1): Uninitialized pointer read (UNINIT)9.
uninit_use: Using uninitialized value fptr.
This commit is contained in:
Giacomo Tesio 2017-01-15 01:59:41 +01:00
parent 1cb4610ed2
commit 237b7709ae
1 changed files with 3 additions and 0 deletions

View File

@ -305,6 +305,9 @@ freelist_pop(int blankslot, int originally_allocated)
}
}
if(fimg == nil)
panic("no free image in sleeping free list");
mkqid(&fimg->qid, ~0, ~0, QTDIR); /* so that it cannot be found by hash */
ptr = *fptr;
*fptr = fimg->fnext;