diff options
author | dyson <dyson@FreeBSD.org> | 1996-01-29 02:57:33 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-01-29 02:57:33 +0000 |
commit | e2c043171a7b51adf1beee9577160cea581f633b (patch) | |
tree | a9670c519a6bbde4514e91fbfac319e893025556 | |
parent | fa485dc0b681e6f896ff7a10f9712d3eef7278f9 (diff) | |
download | FreeBSD-src-e2c043171a7b51adf1beee9577160cea581f633b.zip FreeBSD-src-e2c043171a7b51adf1beee9577160cea581f633b.tar.gz |
Fixed an uninitialized variable (argument to vm_map_find) -- problem
that DG detected, and promptly found a fix.
Submitted by: davidg
-rw-r--r-- | sys/kern/sys_pipe.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index ea45688..1ebbac3 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id$ + * $Id: sys_pipe.c,v 1.1 1996/01/28 23:38:26 dyson Exp $ */ #ifndef OLD_PIPE @@ -147,7 +147,7 @@ static void pipeinit(cpipe) struct pipe *cpipe; { - int npages; + int npages, error; npages = round_page(PIPESIZE)/PAGE_SIZE; @@ -156,15 +156,18 @@ pipeinit(cpipe) * kernel_object. */ cpipe->pipe_buffer.object = vm_object_allocate(OBJT_DEFAULT, npages); + cpipe->pipe_buffer.buffer = (caddr_t) vm_map_min(kernel_map); /* * Insert the object into the kernel map, and allocate kva for it. * The map entry is, by default, pageable. */ - if (vm_map_find(kernel_map, cpipe->pipe_buffer.object, 0, + error = vm_map_find(kernel_map, cpipe->pipe_buffer.object, 0, (vm_offset_t *) &cpipe->pipe_buffer.buffer, PIPESIZE, 1, - VM_PROT_ALL, VM_PROT_ALL, 0) != KERN_SUCCESS) - panic("pipeinit: cannot allocate pipe -- out of kvm"); + VM_PROT_ALL, VM_PROT_ALL, 0); + + if (error != KERN_SUCCESS) + panic("pipeinit: cannot allocate pipe -- out of kvm -- code = %d", error); cpipe->pipe_buffer.in = 0; cpipe->pipe_buffer.out = 0; |