perf tools: Fix inverted error verification bug in thread__fork
authorDavid Ahern <[email protected]>
Wed, 11 Dec 2013 04:35:38 +0000 (21:35 -0700)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 13 Dec 2013 13:30:21 +0000 (10:30 -0300)
Commit 1902efe7f for the new comm infra added the wrong check for return
code on thread__set_comm. err == 0 is normal, so don't return at that
point unless err != 0.

Signed-off-by: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
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;
        }