Module Name: src Committed By: mlelstv Date: Fri Apr 26 17:20:49 UTC 2019
Modified Files: src/sys/kern: sys_pipe.c Log Message: Clean up pipe structure before recycling it. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/kern/sys_pipe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/sys_pipe.c diff -u src/sys/kern/sys_pipe.c:1.146 src/sys/kern/sys_pipe.c:1.147 --- src/sys/kern/sys_pipe.c:1.146 Sun Jun 10 17:54:51 2018 +++ src/sys/kern/sys_pipe.c Fri Apr 26 17:20:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_pipe.c,v 1.146 2018/06/10 17:54:51 jdolecek Exp $ */ +/* $NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $ */ /*- * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.146 2018/06/10 17:54:51 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1331,6 +1331,8 @@ pipeclose(struct pipe *pipe) free_resources: pipe->pipe_pgid = 0; pipe->pipe_state = PIPE_SIGNALR; + pipe->pipe_peer = NULL; + pipe->pipe_lock = NULL; pipe_free_kmem(pipe); if (pipe->pipe_kmem != 0) { pool_cache_put(pipe_rd_cache, pipe);