From patchwork Wed Oct 11 08:56:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13416903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22CF2CD6E4B for ; Wed, 11 Oct 2023 08:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345779AbjJKI5H (ORCPT ); Wed, 11 Oct 2023 04:57:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345722AbjJKI5B (ORCPT ); Wed, 11 Oct 2023 04:57:01 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B96C98; Wed, 11 Oct 2023 01:56:59 -0700 (PDT) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39B8lS09026676; Wed, 11 Oct 2023 08:56:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=MzfWGt5tqCHwOf+a1jw8rKsak/d+6jEm2WR4wIJ29R0=; b=ok9j1K5i/bgPCZJ/ktB4zKoelg77qP8sobRfqMBSIlcFBAUpKKQEb+TEXi10Mo+bIC+l xk1f0+ryvulN0LKieN1G7XZP+icuvKi5wXydUcXVqpEIVmUnRXD3faG+y/TT6kTD3erH 13VQbSuawJqQ8637ORcE3olFV/Y8N5E2VLGD6aedQ/vrwdkE/mZy7kp6ytWAuYPagz9I dGso7c6T88K137Slw1FiDbae1gA8Mg3up8c9IDHFfkfkYj/V/N86aiZKAe8Y8rr+zOFZ ywtVRCchHVrptC4hp0AB/49PHM04abG1unXpEh1zZyBNpfaH6H7c5oT7F25C+ceVwWuE 5w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tnrgg0abd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Oct 2023 08:56:46 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39B8lxWg028265; Wed, 11 Oct 2023 08:56:45 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tnrgg0aap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Oct 2023 08:56:45 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39B8UclD026364; Wed, 11 Oct 2023 08:56:44 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tkjnneuum-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Oct 2023 08:56:44 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39B8ufI711928124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 08:56:41 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0EE2920043; Wed, 11 Oct 2023 08:56:41 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C133320040; Wed, 11 Oct 2023 08:56:40 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Oct 2023 08:56:40 +0000 (GMT) From: Nina Schoetterl-Glausch To: Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= Cc: Nina Schoetterl-Glausch , Andrew Jones , Colton Lewis , Nikos Nikoleris , Ricardo Koller , Sean Christopherson , Thomas Huth , David Hildenbrand , linux-s390@vger.kernel.org, kvm@vger.kernel.org Subject: [kvm-unit-tests PATCH 3/9] s390x: topology: Fix parsing loop Date: Wed, 11 Oct 2023 10:56:26 +0200 Message-Id: <20231011085635.1996346-4-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011085635.1996346-1-nsg@linux.ibm.com> References: <20231011085635.1996346-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: RwbANQuwNvo80-sklW-gJfA9nvgFBOB5 X-Proofpoint-GUID: LPa7ACeHnYHhXbe9n9WBP4G1r4y_Pi4b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_06,2023-10-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=851 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 phishscore=0 impostorscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110078 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Without a comparison the loop is infinite. Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Nico Boehr --- s390x/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/topology.c b/s390x/topology.c index e1bb6014..49d6dfeb 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -466,7 +466,7 @@ static void parse_topology_args(int argc, char **argv) if (flag[0] != '-') report_abort("Argument is expected to begin with '-'"); flag++; - for (level = 0; ARRAY_SIZE(levels); level++) { + for (level = 0; level < ARRAY_SIZE(levels); level++) { if (!strcmp(levels[level], flag)) break; }