From e2c043171a7b51adf1beee9577160cea581f633b Mon Sep 17 00:00:00 2001 From: dyson Date: Mon, 29 Jan 1996 02:57:33 +0000 Subject: Fixed an uninitialized variable (argument to vm_map_find) -- problem that DG detected, and promptly found a fix. Submitted by: davidg --- sys/kern/sys_pipe.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sys/kern/sys_pipe.c') 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; -- cgit v1.1