virBufferEscapeString already contains the null check. Signed-off-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx> --- src/conf/node_device_conf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 68924b3027..9a0fc68e67 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -669,16 +669,14 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) virBufferAdjustIndent(&buf, 2); virBufferEscapeString(&buf, "<name>%s</name>\n", def->name); virBufferEscapeString(&buf, "<path>%s</path>\n", def->sysfs_path); - if (def->devnode) - virBufferEscapeString(&buf, "<devnode type='dev'>%s</devnode>\n", - def->devnode); + virBufferEscapeString(&buf, "<devnode type='dev'>%s</devnode>\n", + def->devnode); if (def->devlinks) { for (i = 0; def->devlinks[i]; i++) virBufferEscapeString(&buf, "<devnode type='link'>%s</devnode>\n", def->devlinks[i]); } - if (def->parent) - virBufferEscapeString(&buf, "<parent>%s</parent>\n", def->parent); + virBufferEscapeString(&buf, "<parent>%s</parent>\n", def->parent); if (def->driver) { virBufferAddLit(&buf, "<driver>\n"); virBufferAdjustIndent(&buf, 2); -- 2.42.0 _______________________________________________ Devel mailing list -- devel@xxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx