From patchwork Thu Oct 12 08:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?0JzQuNGA0L7QvdC+0LIg0KHQtdGA0LPQtdC5INCS0LvQsNC00LjQvNC40YDQvtCy0LjRhw==?= X-Patchwork-Id: 1847321 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S5jzY70crz23jd for ; Thu, 12 Oct 2023 19:51:21 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqrPA-0003Wn-KY; Thu, 12 Oct 2023 04:50:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqrP8-0003WV-NU for qemu-devel@nongnu.org; Thu, 12 Oct 2023 04:50:50 -0400 Received: from exchange.fintech.ru ([195.54.195.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1qqrP6-0005g4-Ep for qemu-devel@nongnu.org; Thu, 12 Oct 2023 04:50:50 -0400 Received: from Ex16-02.fintech.ru (10.0.10.19) by exchange.fintech.ru (195.54.195.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Thu, 12 Oct 2023 11:50:16 +0300 Received: from infra.fintech.ru (10.10.1.240) by Ex16-02.fintech.ru (10.0.10.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Thu, 12 Oct 2023 11:50:16 +0300 From: Sergey Mironov To: , , CC: Sergey Mironov Subject: [PATCH 100742/100742] target/arm: Adding a check for the result of calling the CPU information check function Date: Thu, 12 Oct 2023 11:50:05 +0300 Message-ID: <20231012085005.848149-1-mironov@fintech.ru> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.10.1.240] X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-02.fintech.ru (10.0.10.19) Received-SPF: pass client-ip=195.54.195.159; envelope-from=mironov@fintech.ru; helo=exchange.fintech.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 6 out of 7 calls to get_arm_cp_reginfo() are checked Signed-off-by: Sergey Mironov --- target/arm/helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 74fbb6e1d7..cffbbaf571 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -198,6 +198,7 @@ static void add_cpreg_to_list(gpointer key, gpointer opaque) uint32_t regidx = (uintptr_t)key; const ARMCPRegInfo *ri = get_arm_cp_reginfo(cpu->cp_regs, regidx); + assert(ri != NULL); if (!(ri->type & (ARM_CP_NO_RAW | ARM_CP_ALIAS))) { cpu->cpreg_indexes[cpu->cpreg_array_len] = cpreg_to_kvm_id(regidx); /* The value array need not be initialized at this point */