From: Michal Privoznik Date: Mon, 15 Feb 2021 16:13:22 +0000 (+0100) Subject: qemu: Drop needless check in virDomainFSInfoFormat() X-Git-Tag: v7.1.0-rc1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5922b2b104d60965fbf367e042dbb4dee366a424;p=thirdparty%2Flibvirt.git qemu: Drop needless check in virDomainFSInfoFormat() As the very first thing, this function checks whether the number of items inside @agentinfo array is not negative. This is redundant as the only caller - qemuDomainGetFSInfo() already checked for that and would not even call this function if that was the case. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3d54653217..f59f9e13ba 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18966,8 +18966,6 @@ virDomainFSInfoFormat(qemuAgentFSInfoPtr *agentinfo, virDomainFSInfoPtr *info_ret = NULL; size_t i; - if (nagentinfo < 0) - return ret; info_ret = g_new0(virDomainFSInfoPtr, nagentinfo); for (i = 0; i < nagentinfo; i++) {