perf tools: Fix inverted error verification bug in thread__fork
[firefly-linux-kernel-4.4.55.git] / tools / perf / util / thread.c
index 49eaf1d7d89d0554a146a272e923cd139e6cbac7..e3948612543e9faabc62cdf8fd2c7cd364568c6a 100644 (file)
@@ -126,7 +126,7 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp)
                if (!comm)
                        return -ENOMEM;
                err = thread__set_comm(thread, comm, timestamp);
-               if (!err)
+               if (err)
                        return err;
                thread->comm_set = true;
        }