kvm: kvmtrace: Call pthread_join only to created threads
commita6061fa2dd1b81b26872e6588ed56d3ff30673ae
authorRyota OZAKI <ozaki.ryota@gmail.com>
Sat, 4 Oct 2008 07:20:30 +0000 (4 16:20 +0900)
committerAvi Kivity <avi@redhat.com>
Sun, 5 Oct 2008 09:59:52 +0000 (5 11:59 +0200)
tree2a70320b32b003e9bd08b5274bea9ed3e6f32c9f
parenta192b8b6bf4e7269e862fa2a8e63fd4f4bd540aa
kvm: kvmtrace: Call pthread_join only to created threads

If thread_main fails (e.g. open fails)
before all threads are created, pthread_join() is called on an
uncreated thread and a segmentation fault occurs.

This patch checks whether a thread is created before calling
pthread_join to the thread.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
kvm/user/kvmtrace.c