diff options
author | John Dyson <dyson@FreeBSD.org> | 1996-01-29 02:57:33 +0000 |
---|---|---|
committer | John Dyson <dyson@FreeBSD.org> | 1996-01-29 02:57:33 +0000 |
commit | 4fd00d508b0b3231357e4a5cbdd15aa62417ef8b (patch) | |
tree | a9670c519a6bbde4514e91fbfac319e893025556 /sys/kern | |
parent | f352f5418c12a60719cf297a5abd9c7757db2022 (diff) | |
download | src-4fd00d508b0b3231357e4a5cbdd15aa62417ef8b.tar.gz src-4fd00d508b0b3231357e4a5cbdd15aa62417ef8b.zip |
Fixed an uninitialized variable (argument to vm_map_find) -- problem
that DG detected, and promptly found a fix.
Submitted by: davidg
Notes
Notes:
svn path=/head/; revision=13688
Diffstat (limited to 'sys/kern')
-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 ea4568804163..1ebbac3cef6d 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; |