From patchwork Fri Oct 20 14:48:54 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: 13430857 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 B0A6CC07480 for ; Fri, 20 Oct 2023 15:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377590AbjJTPDR (ORCPT ); Fri, 20 Oct 2023 11:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377607AbjJTPDP (ORCPT ); Fri, 20 Oct 2023 11:03:15 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63480D53; Fri, 20 Oct 2023 08:03:14 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEtV3D019439; Fri, 20 Oct 2023 15:03:10 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=+0NkxCqHEVgJad9TgLdnvKFXtu8mkbnKwCThHDwLjXM=; b=W2rYqIOrFbz2WKAEUFfDjtrLCQ09b0oFT2MUt3222HIowvDujUK3IZRdU1tyAw9++UVA vsP+wiuZQfNa2nbfzyzu8Z04nwPSbyQpJA/cFDdh5xum6DJh6GDEHKVwOsIWyhAYnpiV NMzMEPAl56RiwXK/gkCtG8R1p/mqvI5MD+EbsofL5vQoQ25jw82lkVQjflvRV2TlvmJ3 K0YGekbQXsj1XpU3QG3dnQgt8MThHWRjrAHhvI467Cr5aevvFTnXF9n/Mhyihotp3H/I jCn83vf3rcPATCibEiaMID8GyIH47NpKuGQozXqOWceRAVD6JsmvOXdseLUFZpa9ZNEU jQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuur5rer8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:03:09 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KEtnjv020669; Fri, 20 Oct 2023 15:03:08 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuur5rdj1-18 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:03:08 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCKV8K007107; Fri, 20 Oct 2023 14:49:08 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tuc27n6sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:08 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn5MF16646846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:05 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 227EE20040; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2D5B20043; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) From: Nina Schoetterl-Glausch To: Claudio Imbrenda , Janosch Frank , =?utf-8?q?Nico_B=C3=B6hr?= Cc: Nina Schoetterl-Glausch , Thomas Huth , linux-s390@vger.kernel.org, kvm@vger.kernel.org, Colton Lewis , Shaoqin Huang , Nikos Nikoleris , David Hildenbrand , Ricardo Koller , Sean Christopherson , Andrew Jones Subject: [kvm-unit-tests PATCH 04/10] s390x: topology: Fix parsing loop Date: Fri, 20 Oct 2023 16:48:54 +0200 Message-Id: <20231020144900.2213398-5-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: tLtx3vDJIYe2HB-zUyMeYCE8ZiZpxO5S X-Proofpoint-ORIG-GUID: NTEHENZgmIyBsKl_moBJRmP-gnB-nh5j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=875 impostorscore=0 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200124 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Without a comparison the loop is infinite. Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Janosch Frank --- s390x/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/topology.c b/s390x/topology.c index 032e80dc..c8ad4bcb 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -468,7 +468,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; }