From e10a4c67c3957c4e0833ab0eff367be4b91049eb Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Fri, 8 Apr 2016 10:41:36 +0300 Subject: [PATCH] vz: make error path code idiomatic Signed-off-by: Nikolay Shirokovskiy Signed-off-by: Maxim Nestratov --- src/vz/vz_sdk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index b595fe72d5..4fe9bfa5c0 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -3777,8 +3777,7 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def) } - ret = prlsdkDoApplyConfig(driver, sdkdom, def, NULL); - if (ret) + if (prlsdkDoApplyConfig(driver, sdkdom, def, NULL) < 0) goto cleanup; flags = PACF_NON_INTERACTIVE_MODE; @@ -3786,7 +3785,9 @@ prlsdkCreateCt(vzDriverPtr driver, virDomainDefPtr def) flags |= PRNVM_PRESERVE_DISK; job = PrlVm_RegEx(sdkdom, "", flags); if (PRL_FAILED(waitJob(job))) - ret = -1; + goto cleanup; + + ret = 0; cleanup: PrlHandle_Free(sdkdom); -- GitLab