diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5ac4f011f9..425e3c3710 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17649,7 +17649,11 @@ virDomainDiskByName(virDomainDefPtr def, bool allow_ambiguous) { int idx = virDomainDiskIndexByName(def, name, allow_ambiguous); - return idx < 0 ? NULL : def->disks[idx]; + + if (idx < 0) + return NULL; + + return def->disks[idx]; }