From nobody Wed May 15 09:19:55 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; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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=1607621601; cv=none; d=zohomail.com; s=zohoarc; b=LlMla7MNXHwyku55VVxzJenDU9qnBnlQD04Wklm2V41TW/9JsQBXIqDJLYysCT4kqxoc1DYptJukKgpDTUJhwDAzMJh2iYXI0vLihAZrZXsrbSRJvMECU2bJiTLsUuB6CDG86KgN8XY2pWYiTyrJqJ7/UhrduERS31ad2xWbeao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607621601; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=tgkVutwWPGic60mclb9H4hQf8Jf2+m7sOg6ptkiTtpU=; b=UYkDAG2bj/28mQPK+q/8G0eoUioq4721VDeLCH/4ajBslPBmpiaJb9dlpDnm6g2B91U5r9/KXGIhg/4epHyntsXbIc8iD3KeB/NIaK87KQAg7j7DwqFUvGW/zgsPb8zK88Z4s4/WLs8DFqGE1r/BX0srG5UfvfSxJiMFdVy09NI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 16076216017061009.7373085540122; Thu, 10 Dec 2020 09:33:21 -0800 (PST) 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-50-mHsVlNGAMdKMOqXktJHOEw-1; Thu, 10 Dec 2020 12:33:14 -0500 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 DE461858180; Thu, 10 Dec 2020 17:33:07 +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 487F05D6D3; Thu, 10 Dec 2020 17:33:07 +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 5BC53180954D; Thu, 10 Dec 2020 17:33:05 +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 0BAHX3rx003573 for ; Thu, 10 Dec 2020 12:33:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id D49C72166B29; Thu, 10 Dec 2020 17:33:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEB682166B2A for ; Thu, 10 Dec 2020 17:33:01 +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 B39CE811E78 for ; Thu, 10 Dec 2020 17:33:01 +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-593-685bqxiTOra0lb_9Rfhzjw-1; Thu, 10 Dec 2020 12:32:57 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BAHVx0M155412; Thu, 10 Dec 2020 12:32:55 -0500 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 35br2y8484-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 12:32:55 -0500 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BAHRZtT013499; Thu, 10 Dec 2020 17:32:52 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma06ams.nl.ibm.com with ESMTP id 3581fhp1nr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 17:32:52 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BAHWnOP22610254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Dec 2020 17:32:49 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1FCE7A405D; Thu, 10 Dec 2020 17:32:49 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E13B0A404D; Thu, 10 Dec 2020 17:32:48 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.168.122]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 10 Dec 2020 17:32:48 +0000 (GMT) X-MC-Unique: mHsVlNGAMdKMOqXktJHOEw-1 X-MC-Unique: 685bqxiTOra0lb_9Rfhzjw-1 From: Boris Fiuczynski To: libvir-list@redhat.com, eskultet@redhat.com, shalini@linux.ibm.com, jferlan@redhat.com Subject: [PATCH] node_device: pacify grumpy coverity due to addr override Date: Thu, 10 Dec 2020 18:32:36 +0100 Message-Id: <20201210173236.242991-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.343, 18.0.737 definitions=2020-12-10_06:2020-12-09, 2020-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 clxscore=1011 suspectscore=0 spamscore=0 impostorscore=0 bulkscore=0 adultscore=0 mlxscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012100106 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: Boris Fiuczynski 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 Content-Type: text/plain; charset="utf-8" With commit 09364608b4 node_device: refactor address retrieval of node devi= ce "if-else if" was replaced by "switch". The contained break statement now is no longer in context of the for loop but instead of the switch causing the legitimate grumpiness of coverity. Signed-off-by: Boris Fiuczynski Suggested-by: John Ferlan Reviewed-by: Michal Privoznik --- src/node_device/node_device_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index e254b49244..da1bc8a545 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -637,7 +637,7 @@ nodeDeviceFindAddressByName(const char *name) } =20 def =3D virNodeDeviceObjGetDef(dev); - for (caps =3D def->caps; caps !=3D NULL; caps =3D caps->next) { + for (caps =3D def->caps; caps !=3D NULL && addr =3D=3D NULL; caps =3D = caps->next) { switch (caps->data.type) { case VIR_NODE_DEV_CAP_PCI_DEV: { virPCIDeviceAddress pci_addr =3D { --=20 2.26.2