From nobody Mon May 13 14:50:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1649096594076507.323286458948; Mon, 4 Apr 2022 11:23:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-246-VKRS59bqPBmBGetPimagXw-1; Mon, 04 Apr 2022 14:23:07 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2A0BD3801ED5; Mon, 4 Apr 2022 18:23:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B740C145831C; Mon, 4 Apr 2022 18:23:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 72DD51940366; Mon, 4 Apr 2022 18:23:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7973B19451EF for ; Mon, 4 Apr 2022 18:23:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6A31E2166B4A; Mon, 4 Apr 2022 18:23:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 65B632166B48 for ; Mon, 4 Apr 2022 18:22:52 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FD9C3C14102 for ; Mon, 4 Apr 2022 18:22:52 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-18-dDFmYewyOaCLTlH3dwYqIA-1; Mon, 04 Apr 2022 14:22:50 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 234GetFS028618 for ; Mon, 4 Apr 2022 18:22:50 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3f705h4s49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 Apr 2022 18:22:50 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 234IHIJu029398 for ; Mon, 4 Apr 2022 18:22:48 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 3f6e48v5p3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 Apr 2022 18:22:48 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 234IMjUv32964966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Apr 2022 18:22:45 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67CD652050; Mon, 4 Apr 2022 18:22:45 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.71.213]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4720B5204F; Mon, 4 Apr 2022 18:22:45 +0000 (GMT) X-MC-Unique: VKRS59bqPBmBGetPimagXw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: dDFmYewyOaCLTlH3dwYqIA-1 From: Boris Fiuczynski To: libvir-list@redhat.com Subject: [PATCH] tests: Fixing compiler warning in cputest Date: Mon, 4 Apr 2022 20:22:37 +0200 Message-Id: <20220404182237.7899-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zo2JbLKqtxxTHjGXIH_RJ2Gj__0e2IHT X-Proofpoint-ORIG-GUID: zo2JbLKqtxxTHjGXIH_RJ2Gj__0e2IHT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-04_06,2022-03-31_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 spamscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=631 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204040103 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id 234GetFS028618 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-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Fiuczynski Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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-ZM-MESSAGEID: 1649096594455100001 Content-Type: text/plain; charset="utf-8" Found when building on Fedora 36 on s390x. C compiler for the host machine: gcc (gcc 12.0.1 "gcc (GCC) 12.0.1 2022030= 8 (Red Hat 12.0.1-0)") C linker for the host machine: gcc ld.bfd 2.37-24 In function =E2=80=98cpuTestUpdateLiveCompare=E2=80=99, inlined from =E2=80=98cpuTestUpdateLive=E2=80=99 at ../dist-unpack/lib= virt-8.2.5/tests/cputest.c:784:12: ../dist-unpack/libvirt-8.2.5/tests/cputest.c:696:21: warning: potential nu= ll pointer dereference [-Wnull-dereference] 696 | featAct->policy =3D=3D VIR_CPU_FEATURE_REQUIRE) || | ~~~~~~~^~~~~~~~ Signed-off-by: Boris Fiuczynski Reviewed-by: Michal Privoznik --- tests/cputest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cputest.c b/tests/cputest.c index 609b5df7c6..95fb37d15c 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -692,7 +692,7 @@ cpuTestUpdateLiveCompare(virArch arch, if ((cmp =3D=3D 0 && featAct->policy =3D=3D VIR_CPU_FEATURE_REQUIRE && featExp->policy =3D=3D VIR_CPU_FEATURE_DISABLE) || - (cmp < 0 && + (cmp < 0 && featAct && featAct->policy =3D=3D VIR_CPU_FEATURE_REQUIRE) || (cmp > 0 && featExp->policy =3D=3D VIR_CPU_FEATURE_DISABLE)) { --=20 2.33.1