From nobody Mon Nov 25 14:49:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602770571; cv=none; d=zohomail.com; s=zohoarc; b=CHuHQQqoR9wk595Z7g2fMZncXhUggoMLC+Ge04O2ASeO0wr4l8I0Ju36mVr34mK27ZmAJpCkSfvKnnnAQUUvoO6km2y431OSgIzSzPi+jEUTPMiy4YfKtfg2sY6M/+9fbNg0aZjnBmR2EojZTAultc7XFsvw6LtXQ2tUrU2/KAY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602770571; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=702FxMpxlxx1PM6tG6BfMXzQHPvTmmnctOmMRh407rI=; b=YAC9vR7yljcPQ1w6mZPKof7Bh2pK5lmGonKtJDZkCs9UrbOwQwoYnxzgy75p8sMGvpEcrTDxLdey0E3Y6avvGoqpPQq4smROxnhzYfdhJ07KlcHaSKWNsImyaEGYSpdQ9mXyjRJJM+la7HreiajmFAmcjnygW+gRgMn9njqTUBI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1602770570944756.9767017930179; Thu, 15 Oct 2020 07:02:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-v8ACxoEvMqGAdQt8PT_CyQ-1; Thu, 15 Oct 2020 10:02:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CEAAA109795E; Thu, 15 Oct 2020 14:01:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9DDD75128; Thu, 15 Oct 2020 14:01:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 476045810D; Thu, 15 Oct 2020 14:01:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09FE0F3T002755 for ; Thu, 15 Oct 2020 10:00:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A3E65C22D; Thu, 15 Oct 2020 14:00:15 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDB2E5C1BD for ; Thu, 15 Oct 2020 14:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602770568; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=702FxMpxlxx1PM6tG6BfMXzQHPvTmmnctOmMRh407rI=; b=DD8zo5d2j9NRrpg5KFbUSG2eDoFW7UscIBNehfLFTJiN3bHS4FSmoQBJkEN+miVABMvUYj R9B8d0vkSeUSB2xyiVIYPNODQlxB8fobdcX2TgpnW4GMaQuLjBFYQxp6Qlg9qPQZubV6h2 z7E/oQZDAa6Rvd7IDqmf1807hr6ihec= X-MC-Unique: v8ACxoEvMqGAdQt8PT_CyQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/5] hyperv: Drop needless label in hypervDomainSetMemoryFlags() Date: Thu, 15 Oct 2020 16:00:08 +0200 Message-Id: <1e0fabdb09b1f31ee6bc80b12c9bc89a6c35175d.1602770344.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now, that hypervInvokeMethod() clears the passed pointer we don't need a special cleanup label ('params_cleanup') that handles non-obvious ownership transfer. Signed-off-by: Michal Privoznik --- src/hyperv/hyperv_driver.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index eeb65bd4d7..dd08e573c0 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1765,7 +1765,7 @@ hypervDomainSetMemoryFlags(virDomainPtr domain, unsig= ned long memory, =20 if (hypervAddEprParam(params, "ComputerSystem", priv, &eprQuery, Msvm_ComputerSystem_WmiInfo) < 0) - goto params_cleanup; + goto cleanup; } else if (priv->wmiVersion =3D=3D HYPERV_WMI_VERSION_V2) { params =3D hypervCreateInvokeParamsList(priv, "ModifyResourceSetti= ngs", MSVM_VIRTUALSYSTEMMANAGEMENTSERVICE_SELECTOR, @@ -1779,31 +1779,31 @@ hypervDomainSetMemoryFlags(virDomainPtr domain, uns= igned long memory, =20 memResource =3D hypervCreateEmbeddedParam(priv, Msvm_MemorySettingData= _WmiInfo); if (!memResource) - goto params_cleanup; + goto cleanup; =20 if (hypervSetEmbeddedProperty(memResource, "VirtualQuantity", memory_s= tr) < 0) { hypervFreeEmbeddedParam(memResource); - goto params_cleanup; + goto cleanup; } =20 if (hypervSetEmbeddedProperty(memResource, "InstanceID", memsd->data.common->InstanceID) < 0) { hypervFreeEmbeddedParam(memResource); - goto params_cleanup; + goto cleanup; } =20 if (priv->wmiVersion =3D=3D HYPERV_WMI_VERSION_V1) { if (hypervAddEmbeddedParam(params, priv, "ResourceSettingData", memResource, Msvm_MemorySettingData_WmiInfo) < 0) { hypervFreeEmbeddedParam(memResource); - goto params_cleanup; + goto cleanup; } =20 } else if (priv->wmiVersion =3D=3D HYPERV_WMI_VERSION_V2) { if (hypervAddEmbeddedParam(params, priv, "ResourceSettings", memResource, Msvm_MemorySettingData_WmiInfo) < 0) { hypervFreeEmbeddedParam(memResource); - goto params_cleanup; + goto cleanup; } } =20 @@ -1813,14 +1813,12 @@ hypervDomainSetMemoryFlags(virDomainPtr domain, uns= igned long memory, } =20 result =3D 0; - goto cleanup; =20 - params_cleanup: - hypervFreeInvokeParams(params); cleanup: VIR_FREE(memory_str); hypervFreeObject(priv, (hypervObject *)vssd); hypervFreeObject(priv, (hypervObject *)memsd); + hypervFreeInvokeParams(params); return result; } =20 --=20 2.26.2