From nobody Sun Feb 8 07:52:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1603474353; cv=none; d=zohomail.com; s=zohoarc; b=akmVPoGfB5O9M6n6pOYW/S2d9srhcZd2TWWdsDQ7aTwesnVRHh/qhkzjhqZ3aB/wsxQOGRXDKrTcbFqxUgC3ExaZMmexKEkZWioX33tSe1u/f1FvHGjkX9cGKYH7zans+jMr5JJwVmPHxN2yFcYm9cnMt36D13laZmT6DTT9ahI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603474353; 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=luhDiNRx/YKYL8mGmHNGObUS33IZ5nD9p0js1Un/X+U=; b=ZELCc4EPqssuwzbvMF6eSWOcFf5esoOEcG8glO0rgkoyzUUm2UVJ2+1P40KwXLQhlQSpyWLJ+oTlP7jzIBziYm9B4ZmQvrxIxttMxvJbwTCL7Ff/jNXLigQ2f8vVwETOHs8x7w1KhZ/iuB9etrAvtKS5RJP2xtfH+xlWIP/jZ50= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603474353036801.8287797575961; Fri, 23 Oct 2020 10:32: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-463-lytxcL9HMRebHI29JlfbYw-1; Fri, 23 Oct 2020 13:32:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 702A1807339; Fri, 23 Oct 2020 17:32:23 +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 4FAC79CBA0; Fri, 23 Oct 2020 17:32: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 1E1E09230F; Fri, 23 Oct 2020 17:32:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09NHWJdP000779 for ; Fri, 23 Oct 2020 13:32:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id E52B22156A3C; Fri, 23 Oct 2020 17:32:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DFD5B2156A39 for ; Fri, 23 Oct 2020 17:32:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 7064C858284 for ; Fri, 23 Oct 2020 17:32:15 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-Akonxrw9N9ijDwLv6i_3MA-1; Fri, 23 Oct 2020 13:32:12 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09NHVked095887; Fri, 23 Oct 2020 13:32:11 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 34c1w0bg1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Oct 2020 13:32:11 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09NHNQkW004113; Fri, 23 Oct 2020 17:32:09 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03ams.nl.ibm.com with ESMTP id 348d5qx0tw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Oct 2020 17:32:09 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09NHW7ZD20447552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Oct 2020 17:32:07 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1397542049; Fri, 23 Oct 2020 17:32:07 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E87B54204D; Fri, 23 Oct 2020 17:32:06 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.42.215]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 23 Oct 2020 17:32:06 +0000 (GMT) X-MC-Unique: lytxcL9HMRebHI29JlfbYw-1 X-MC-Unique: Akonxrw9N9ijDwLv6i_3MA-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH 09/10] conf: node_device: cleanup virNodeDevCapCCWParseXML Date: Fri, 23 Oct 2020 19:31:51 +0200 Message-Id: <20201023173152.45238-10-fiuczy@linux.ibm.com> In-Reply-To: <20201023173152.45238-1-fiuczy@linux.ibm.com> References: <20201023173152.45238-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-23_12:2020-10-23, 2020-10-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 spamscore=0 suspectscore=3 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010230109 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.6 X-loop: libvir-list@redhat.com Cc: eskultet@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.13 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 Content-Type: text/plain; charset="utf-8" Make use of g_autofree Signed-off-by: Boris Fiuczynski Reviewed-by: Bjoern Walk Reviewed-by: J=C3=A1n Tomko --- src/conf/node_device_conf.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index ebabf20b67..39950565b5 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -839,57 +839,52 @@ virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt, virNodeDevCapCCWPtr ccw_dev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - int ret =3D -1; - char *cssid =3D NULL, *ssid =3D NULL, *devno =3D NULL; + g_autofree char *cssid =3D NULL; + g_autofree char *ssid =3D NULL; + g_autofree char *devno =3D NULL; =20 ctxt->node =3D node; =20 - if (!(cssid =3D virXPathString("string(./cssid[1])", ctxt))) { + if (!(cssid =3D virXPathString("string(./cssid[1])", ctxt))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("missing cssid value for '%s'"), def->name); - goto out; + return -1; } =20 if (virStrToLong_uip(cssid, NULL, 0, &ccw_dev->cssid) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("invalid cssid value '%s' for '%s'"), cssid, def->name); - goto out; + return -1; } =20 if (!(ssid =3D virXPathString("string(./ssid[1])", ctxt))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("missing ssid value for '%s'"), def->name); - goto out; + return -1; } =20 if (virStrToLong_uip(ssid, NULL, 0, &ccw_dev->ssid) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("invalid ssid value '%s' for '%s'"), cssid, def->name); - goto out; + return -1; } =20 if (!(devno =3D virXPathString("string(./devno[1])", ctxt))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("missing devno value for '%s'"), def->name); - goto out; + return -1; } =20 if (virStrToLong_uip(devno, NULL, 16, &ccw_dev->devno) < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("invalid devno value '%s' for '%s'"), devno, def->name); - goto out; + return -1; } =20 - ret =3D 0; - - out: - VIR_FREE(cssid); - VIR_FREE(ssid); - VIR_FREE(devno); - return ret; + return 0; } =20 =20 --=20 2.25.1