Initialize paddr to handle the case of zero size.

Reported and reviewed by:	Conrad Meyer <cemeyer@uw.edu>
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2014-03-12 16:38:55 +00:00
parent 031925742a
commit 7253a5ec63

View File

@ -414,6 +414,7 @@ old_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot,
* XXX assumes VM_PROT_* == PROT_*
*/
npages = OFF_TO_IDX(size);
paddr = 0; /* Make paddr initialized for the case of size == 0. */
for (off = foff; npages--; off += PAGE_SIZE) {
if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) {
dev_relthread(dev, ref);