[PATCH v6 13/27] util/log: add missing error reporting in qemu_log_trylock_with_err

Daniel P. Berrangé posted 27 patches 20 hours ago
There is a newer version of this series
[PATCH v6 13/27] util/log: add missing error reporting in qemu_log_trylock_with_err
Posted by Daniel P. Berrangé 20 hours ago
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>
---
 util/log.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util/log.c b/util/log.c
index 1644e6814b..1c9c7adb2d 100644
--- a/util/log.c
+++ b/util/log.c
@@ -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;
             }
         }
-- 
2.53.0