]> git.ipfire.org Git - thirdparty/libvirt.git/commit
ch_driver: Handle validation failure correctly
authorWilliam Douglas <william.douglas@intel.com>
Wed, 8 Sep 2021 18:01:23 +0000 (11:01 -0700)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 9 Sep 2021 13:51:02 +0000 (14:51 +0100)
commitc88b26a656a48a976300b4f0e1745058307f5a89
tree5c545ef9cc5e2ba2c3fb1f56a85968b645111158
parentd4f047dbd1eba780d405fb79217bcb315366f969
ch_driver: Handle validation failure correctly

When validation like deviceValidateCallback fails, the vm will not be
set and so the call to virDomainObjListRemove will be passed a NULL
pointer causing a segfault. To prevent this add a check that the vm is
defined before calling out to virDomainObjListRemove.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
src/ch/ch_driver.c