From a20011aca63edbbb9aca44e5b23a9030c7e35711 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Wed, 23 Apr 2014 14:06:00 +0400 Subject: [PATCH] ns: initialize nsid in rst_add_ns_id Execute zdtm/live/static/pipe00 ./pipe00 --pidfile=pipe00.pid --outfile=pipe00.out Dump 3158 Restore test/zdtm.sh: line 472: 3173 Segmentation fault (core dumped) setsid restore --file-locks --tcp-established -x -D -o Reported-by: Jenkins Criuovich Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- namespaces.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/namespaces.c b/namespaces.c index 1143a0285..6be030fc4 100644 --- a/namespaces.c +++ b/namespaces.c @@ -147,7 +147,8 @@ int rst_add_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd) } } - if (rst_new_ns_id(id, pid, nd) == NULL) + nsid = rst_new_ns_id(id, pid, nd); + if (nsid == NULL) return -1; pr_info("Add namespace %d pid %d\n", nsid->id, nsid->pid);