[libvirt PATCH] qemu: qemuBuildChardevCommand: use chrSourcePriv unconditionally

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@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

On Mon, Dec 13, 2021 at 13:30:28 +0100, Ján Tomko wrote:
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@redhat.com> --- Pointed out by Coverity.
src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
participants (2)
-
Ján Tomko
-
Peter Krempa