From 2510d1afaa82797abf368d345e1fbf3da5370c28 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 29 May 2020 15:24:22 +0200 Subject: pkg/report: avoid producing no guilty file If we produce no guilty file at all, the report is mailed only to LKML, which is mostly equivalent to mailing to nobody. If we skip all files, return the first one. --- pkg/report/linux.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index f914bc68d..76a41b3ac 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -445,6 +445,12 @@ nextFile: } return file } + // Avoid producing no guilty file at all, otherwise we mail the report to nobody. + // It's unclear if it's better to return the first one or the last one. + // So far the only test we have has only one file anyway. + if len(files) != 0 { + return files[0] + } return "" } -- cgit mrf-deployment