diff --git a/kernel/perf_event.c b/kernel/perf_event.c index bb06382f98e7ed2c7386ae5f154477ebd77ba59e..180151ff83762c841f66d9e268dcf10fa290b55d 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -664,13 +664,13 @@ group_sched_in(struct perf_event *group_event, } } - if (txn) { - ret = pmu->commit_txn(pmu); - if (!ret) { - pmu->cancel_txn(pmu); + if (!txn) + return 0; - return 0; - } + ret = pmu->commit_txn(pmu); + if (!ret) { + pmu->cancel_txn(pmu); + return 0; } group_error: