diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c index 8cdcf4641c51de6a1f5a4df597280be97833c07e..21c4d9b23c249e6e59db3ca8738b69444de2e8c8 100644 --- a/tools/perf/util/target.c +++ b/tools/perf/util/target.c @@ -122,11 +122,7 @@ int target__strerror(struct target *target, int errnum, BUG_ON(buflen == 0); if (errnum >= 0) { - const char *err = str_error_r(errnum, buf, buflen); - - if (err != buf) - scnprintf(buf, buflen, "%s", err); - + str_error_r(errnum, buf, buflen); return 0; }