From nobody Sun Feb 8 03:32:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599078393; cv=none; d=zohomail.com; s=zohoarc; b=E/Gv15b8GOWoHI8j3E9GgvAH+DtPTNJVWo5utbxF057XzRNJvmu7/g+RlPyc71AUc2D6HrO3JoXyA5xsreOop/Qw7MmdeRGJJa7cQ5yjWe3fgEZeYetGdNEWaLQ4Urain057K67d0COzxbNrMz8JGzE4kO57RwGAa9zLRkw3WGw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599078393; h=Content-Type:Content-Transfer-Encoding:Cc: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=iCNEvcY9Q819E6JrQBu3c0SOIDW2ah8G7ckZNXS4kCY=; b=ZNVkzgKt09A3eXGZDP4qlQdNdoijE4sHnRingLmY54IpsaayyA07LKJxYPWJ4FOoL2ANwZbMoKHfdXzYffv+P8HWhPQ0W9xLsEgD3V5gy8ABF6bwYuo8iXHQcy6xHlzSXtXzfgrRpO0Z+UOJigdv38VDeO2BVJG0r+3K6JPJGy8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599078393487808.445853355139; Wed, 2 Sep 2020 13:26:33 -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-467-5mPsT7QUOrSXmYhfDz0mZg-1; Wed, 02 Sep 2020 16:26:30 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5852F81CAFA; Wed, 2 Sep 2020 20:26:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39F3D87A6C; Wed, 2 Sep 2020 20:26:23 +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 05F40183D020; Wed, 2 Sep 2020 20:26:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 082KQDUw002885 for ; Wed, 2 Sep 2020 16:26:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id A053210F26F0; Wed, 2 Sep 2020 20:26:13 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B51810F26F2 for ; Wed, 2 Sep 2020 20:26:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81CCA18AE94A for ; Wed, 2 Sep 2020 20:26:13 +0000 (UTC) Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-ts4RQBDKOMKHx8GHzT8Mxg-1; Wed, 02 Sep 2020 16:26:11 -0400 Received: by mail-qv1-f67.google.com with SMTP id x7so251427qvi.5 for ; Wed, 02 Sep 2020 13:26:11 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:d5bb:61e:5265:e62b:1233]) by smtp.gmail.com with ESMTPSA id b187sm547176qkd.107.2020.09.02.13.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 13:26:09 -0700 (PDT) X-MC-Unique: 5mPsT7QUOrSXmYhfDz0mZg-1 X-MC-Unique: ts4RQBDKOMKHx8GHzT8Mxg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iCNEvcY9Q819E6JrQBu3c0SOIDW2ah8G7ckZNXS4kCY=; b=hKGXL5OotuCiBGFu9GaCogwKu2kyYKsc4iSSRhqzLoSizlM0TRFpQrisgP0+2ltMUK O/1rvDzdgFOGLvZFNswcRn+V6uHtCvJO8+zKU/FTlsGiZPMoDbAlMcIxjuN0FrwEcNZv 7coh8rRBEor1ER7cDVQQCo33QY8rlD3Yb7wCl/Zplvn/EqWcY8vuT9B/b3ZEHU58XijZ 4pZIxwYNuyw41ICpRLQ31NM9Mb7pPS6ExFHKykYC+3Y9F2r9J62LoxdOCtPKCPR4lzSS d0Gqmum4K0mrwo8WKtZYwhcRVhpU+BEq1emKbtq6NGWHbKYGw/Pf5+yC5VdSVp1QC0s3 8ZDQ== X-Gm-Message-State: AOAM530vtUdaQYNtf9S1vv+63gCGRZyZv0Ua/YpEMVfdVIzwJGksaTFh f0Xy+XmS60WcqDT7Ad7r1IQLavImf/tBFg== X-Google-Smtp-Source: ABdhPJwU6VWhz2TYq5z1uvbxGfQGywUvVoaCJ0M/oby4HxjkIB36tKJrZlGDzrkE0xNxjKJo3SWgjg== X-Received: by 2002:ad4:4973:: with SMTP id p19mr7967654qvy.108.1599078370421; Wed, 02 Sep 2020 13:26:10 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 10/12] cpu_ppc64.c: use g_autoptr() in virCPUppc64GetHost() Date: Wed, 2 Sep 2020 17:25:44 -0300 Message-Id: <20200902202546.483726-11-danielhb413@gmail.com> In-Reply-To: <20200902202546.483726-1-danielhb413@gmail.com> References: <20200902202546.483726-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We don't need to call virCPUppc64DataFree() in a cleanup label. This function is already assigned to the 'dataFree' interface of cpuDriverPPC64, and it will be called by virCPUDataFree(), the autocleanup function of virCPUDataPtr, via driver->dataFree. Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index b7c4864200..bc9d399939 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -622,17 +622,16 @@ static int virCPUppc64GetHost(virCPUDefPtr cpu, virDomainCapsCPUModelsPtr models) { - virCPUDataPtr cpuData =3D NULL; + g_autoptr(virCPUData) cpuData =3D NULL; virCPUppc64Data *data; - int ret =3D -1; =20 if (!(cpuData =3D virCPUDataNew(archs[0]))) - goto cleanup; + return -1; =20 data =3D &cpuData->data.ppc64; =20 if (VIR_ALLOC_N(data->pvr, 1) < 0) - goto cleanup; + return -1; =20 data->len =3D 1; =20 @@ -642,11 +641,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, #endif data->pvr[0].mask =3D 0xfffffffful; =20 - ret =3D ppc64DriverDecode(cpu, cpuData, models); - - cleanup: - virCPUppc64DataFree(cpuData); - return ret; + return ppc64DriverDecode(cpu, cpuData, models); } =20 =20 --=20 2.26.2