]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/perf/builtin-timechart.c
Merge tag 'gvt-fixes-2020-02-12' of https://github.com/intel/gvt-linux into drm-intel...
[linux.git] / tools / perf / builtin-timechart.c
index e0e822695a299ae819c4aac3bc308bb209d46397..9e84fae9b096c9863585a9a35c175eea03946705 100644 (file)
@@ -35,6 +35,7 @@
 #include "util/tool.h"
 #include "util/data.h"
 #include "util/debug.h"
+#include <linux/err.h>
 
 #ifdef LACKS_OPEN_MEMSTREAM_PROTOTYPE
 FILE *open_memstream(char **ptr, size_t *sizeloc);
@@ -1601,8 +1602,8 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name)
                                                         &tchart->tool);
        int ret = -EINVAL;
 
-       if (session == NULL)
-               return -1;
+       if (IS_ERR(session))
+               return PTR_ERR(session);
 
        symbol__init(&session->header.env);