util/log: add missing error reporting in qemu_log_trylock_with_err

One codepath that could return NULL failed to populate the errp
object.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2026-01-13 11:52:02 +00:00
parent 338f63e5f0
commit 03eb6f411f

View File

@@ -118,6 +118,7 @@ static FILE *qemu_log_trylock_with_err(Error **errp)
logfile = qatomic_rcu_read((void **)&global_file);
if (!logfile) {
rcu_read_unlock();
error_setg(errp, "Global log file output is not open");
return NULL;
}
}