[libvirt PATCH] qemu: qemuBuildChardevCommand: use chrSourcePriv unconditionally

Ján Tomko jtomko at redhat.com
Mon Dec 13 12:30:28 UTC 2021


In the QEMU driver, we allocate private source data unconditionally
for every chardev and the rest of the function just assumes it's there.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
Pointed out by Coverity.

 src/qemu/qemu_command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 613f7a5d2a..0017cf6ca7 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1493,7 +1493,7 @@ qemuBuildChardevCommand(virCommand *cmd,
              * secinfo is added only to a TCP serial device during
              * qemuDomainSecretChardevPrepare. Subsequently called
              * functions can just check the config fields */
-            if (chrSourcePriv && chrSourcePriv->secinfo) {
+            if (chrSourcePriv->secinfo) {
                 if (qemuBuildObjectSecretCommandLine(cmd,
                                                      chrSourcePriv->secinfo,
                                                      qemuCaps) < 0)
-- 
2.31.1




More information about the libvir-list mailing list