]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Tue, 4 Aug 2015 10:50:29 +0000 (06:50 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 5 Aug 2015 09:44:46 +0000 (05:44 -0400)
commita16871fef7fd342ab5164dddec820a8b9c645b5e
tree083f42929100aa2ddd36945bfeff02b19845d599
parentee6160b549568133d904aa27a553d66f0b0c01d3
conf: Resolve Coverity FORWARD_NULL

The recent changes to perform SCSI device address checks during the
post parse callbacks ran afoul of the Coverity checker since the changes
assumed that the 'xmlopt' parameter to virDomainDeviceDefPostParse
would be non NULL (commit id 'ca2cf74e87'); however, what was missed
is there was an "if (xmlopt &&" check being made, so Coverity believed
that it could be possible for a NULL 'xmlopt'.

Checking the various calling paths seemingly disproves that. If called
from virDomainDeviceDefParse, there were two other possible calls that
would end up dereffing, so that path could not be NULL. If called via
virDomainDefPostParseDeviceIterator via virDomainDefPostParse there
are two callers (virDomainDefParseXML and qemuParseCommandLine)
which deref xmlopt either directly or through another call.

So I'm removing the check for non-NULL xmlopt.
src/conf/domain_conf.c