From 45ab0e9513c6f93e72783f0801128eadf774178d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 19 Jan 2026 07:35:08 +0100 Subject: pkg/updater: fix autoupdate Start update goroutine even in the case of early returns in UpdateOnStart. Fixes #6619 --- pkg/updater/updater.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/updater/updater.go b/pkg/updater/updater.go index ed4938609..e4420af83 100644 --- a/pkg/updater/updater.go +++ b/pkg/updater/updater.go @@ -125,6 +125,15 @@ func New(cfg *Config) (*Updater, error) { // - ensures that the current executable is fresh // - ensures that we have a working syzkaller build in current func (upd *Updater) UpdateOnStart(autoupdate bool, updatePending, shutdown chan struct{}) { + if autoupdate { + defer func() { + go func() { + upd.waitForUpdate() + close(updatePending) + }() + }() + } + os.RemoveAll(upd.currentDir) latestTag := upd.checkLatest() if latestTag != "" { @@ -180,12 +189,6 @@ func (upd *Updater) UpdateOnStart(autoupdate bool, updatePending, shutdown chan os.Exit(0) } } - if autoupdate { - go func() { - upd.waitForUpdate() - close(updatePending) - }() - } } // waitForUpdate polls and rebuilds syzkaller. -- cgit mrf-deployment