From 8d6f508e64728f9aaa5a624462ac0da325854cad Mon Sep 17 00:00:00 2001 From: Bing Niu Date: Mon, 30 Jul 2018 11:12:40 +0800 Subject: [PATCH] conf: Add return value check to virResctrlAllocForeachCache Add return value check to virResctrlAllocForeachCache in virDomainCachetuneDefFormat. The virResctrlAllocForeachCache does have return value, so need check return value to make sure function executed without error. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 24c0ec2798..77cc73744f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27294,10 +27294,10 @@ virDomainCachetuneDefFormat(virBufferPtr buf, int ret = -1; virBufferSetChildIndent(&childrenBuf, buf); - virResctrlAllocForeachCache(resctrl->alloc, - virDomainCachetuneDefFormatHelper, - &childrenBuf); - + if (virResctrlAllocForeachCache(resctrl->alloc, + virDomainCachetuneDefFormatHelper, + &childrenBuf) < 0) + goto cleanup; if (virBufferCheckError(&childrenBuf) < 0) goto cleanup; -- GitLab