From: Martin Kletzander Date: Tue, 16 Dec 2014 18:59:33 +0000 (+0100) Subject: qemu: Add missing goto error in qemuRestoreCgroupState X-Git-Tag: v1.2.12-rc1~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86759ec61a77f545f9238d83adbfaa16d85fa830;p=thirdparty%2Flibvirt.git qemu: Add missing goto error in qemuRestoreCgroupState Commit af2a1f05 tried clearly separating each condition in qemuRestoreCgroupState() for the sake of readability, however somehow one condition body was missing. That means that the body of the next condition got executed only if both of there were true, which is impossible, thus resulting in a dead code and a logic error. Signed-off-by: Martin Kletzander --- diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 1e383c4382..1acb77d253 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -800,9 +800,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm) goto error; if ((empty = virCgroupHasEmptyTasks(priv->cgroup, - VIR_CGROUP_CONTROLLER_CPUSET)) < 0) - - if (!empty) + VIR_CGROUP_CONTROLLER_CPUSET)) <= 0) goto error; if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)