From patchwork Thu Jun 22 16:08:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 694905 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp1485161wrm; Thu, 22 Jun 2023 09:10:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50Ci+Hs4vInxIXJuhAshOOw19BAkzbVRMMdxmdckHMDO8HluiX7XoGGcITwHNrmj0hmZRQ X-Received: by 2002:a05:6214:2461:b0:631:f426:a4be with SMTP id im1-20020a056214246100b00631f426a4bemr12655960qvb.29.1687450241713; Thu, 22 Jun 2023 09:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687450241; cv=none; d=google.com; s=arc-20160816; b=fw3sZUEhENyta4pic+YZ4QX6WujLM2jJ3V2juMZ3h5UERqjbC3IeWwjAebafLAwI+T 1c0/Ag9XfjgNvC0k/tj5oMmHPpZrYjp/5MzF2QYMf+TDLunarTL2OG/AHQ5p5wqILJiG ERW2Y07vyZr2y95rzlgf7gvEv9zSdu0E/PXhPXXNVyuOPphms5i8s+BK+TDiRPYKLAgo cbVtq44REPq3M9L5gvyQeGHqSnvZgOKOl8K+oaxQP89Z+GVKIqaqF8gYtMpOEDRtme3N jR6l2wXfg4JdH4UDQFNMfvXcOHxsBgokr97ZzLwhxCEhopwHbTbtYB4DzMPJGujEMj8b kysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0HtP5OMiHV1uHyCREuOsPgXLNdWuwc5y+seBeAIuir0=; b=txjA8Npxa7pbn30z9jPr7xO+7HMAoFAWx3a0TL6P0310T144bxthh5XAhsNMAIFCY8 6srXlfjoxjlOSQDVAqmrHBmWsNTgK0Ms1i/zvlQGXriWXn7PQ5rmUT3fVzu5j32Yb+7j U3xikdz1ZdglZtQofCNwbx08m5HLSf6WkpbFz/8PzbevJb6B3M+jwy3G/R1vEAyjRT+D 3kSHb2sdMYoam2HwiDoII3qw3fdoTTSUWogYDSJm+wVOTrTx5LzpDRVzz5RBTO9zH+Wv r5RJsePSM0m3w1MYIlcsHj0ppXDOXQxUlPQFZQnpSFzVWeoxBp2o9Ju+WkDjp4qAUV+G tA+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fD2yFKYV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 14-20020ad45bae000000b0062573f6205esi2813630qvq.556.2023.06.22.09.10.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Jun 2023 09:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fD2yFKYV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCMss-0006E2-4h; Thu, 22 Jun 2023 12:10:12 -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 1qCMsm-00068O-M1 for qemu-devel@nongnu.org; Thu, 22 Jun 2023 12:10:04 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCMsk-00010n-Th for qemu-devel@nongnu.org; Thu, 22 Jun 2023 12:10:04 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3094910b150so7581997f8f.0 for ; Thu, 22 Jun 2023 09:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687450201; x=1690042201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0HtP5OMiHV1uHyCREuOsPgXLNdWuwc5y+seBeAIuir0=; b=fD2yFKYVUSbELRWkgGW0danFEJd49UvIoHVUaoL+iV8IqYQvNfiml31iLxtBJeKK+2 BhYPg4qUhHRzjckRgaA9Y7ICZhNcCZMhqc202pVq8XOrpxWtk6WoH7hxA67ck5XYCSA2 a1mUXkxpR3fQsnOmFzfz0iq4qYue5q1tdAT5/kH9rAuDXlR9gqshBZLvQbP2e7xh87Rz 116ue4dKX7z8nRG43aPZMWOGjKu3Mtzz5LGCpfwr8CqoismIj/q6QyBXeNO1kiC0U6lz /+jW94I7TghlhujpjnaWLHWAqKt+jU29K9hKNOv+XTxyLGAUr4jy4FnAEonFW8sot8W/ zLTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687450201; x=1690042201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0HtP5OMiHV1uHyCREuOsPgXLNdWuwc5y+seBeAIuir0=; b=bUD5J9/23eMSbYAqpt3133bVUQZ54f5BINQMCq0/EvFul6JhGHHaqPstxc2ujYGUPq EdRO2vsBEqa4NPOi7SgZwSExM2YGlktF0oXg3ezkoohbAO7xZ4QiPiwnBt9iWp6aQ4mT CRNKy6hD/d0kvIYa1oWlEtDYN0wwM8LACE1LXEB1XBvVl6RJ+4axlQt0fAL/9oFI06a/ uCAEjgZ2ocBJvVOvhSh8ratmzfY8Rg6FgxWyn1a4FnRqwJnECmuWGVAvq5Zvq92lVZzB W0Ijz/dGwdVDvAYn3XvQAIDScD8aNMkNGP9CEhu08EIwg4Z5Zv/jg2oqzuAf1NPhEBT9 BsXA== X-Gm-Message-State: AC+VfDxpjkDwkRAN1DZI6x8+CLkTwkvb5g+BBo0h9BcVSCSwvgTLbx5T Nwak8dllXuRRdgLK9PGJ7lKMwYXbMctcB++fYu7jrA== X-Received: by 2002:adf:e611:0:b0:309:fcbe:748a with SMTP id p17-20020adfe611000000b00309fcbe748amr17046247wrm.11.1687450201085; Thu, 22 Jun 2023 09:10:01 -0700 (PDT) Received: from localhost.localdomain (230.red-88-28-3.dynamicip.rima-tde.net. [88.28.3.230]) by smtp.gmail.com with ESMTPSA id 18-20020a05600c231200b003f9063fc3cbsm15728619wmo.44.2023.06.22.09.09.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 22 Jun 2023 09:10:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Reinoud Zandijk , qemu-arm@nongnu.org, kvm@vger.kernel.org, Marcel Apfelbaum , Stefano Stabellini , Anthony Perard , Yanan Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Roman Bolshakov , Paolo Bonzini , Paul Durrant , Sunil Muthuswamy , Alexander Graf , Richard Henderson , xen-devel@lists.xenproject.org, Eduardo Habkost , Cameron Esfahani Subject: [PATCH v2 09/16] accel: Remove NVMM unreachable error path Date: Thu, 22 Jun 2023 18:08:16 +0200 Message-Id: <20230622160823.71851-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230622160823.71851-1-philmd@linaro.org> References: <20230622160823.71851-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org g_malloc0() can not fail. Remove the unreachable error path. https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/i386/nvmm/nvmm-all.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index 50b96ced45..0588a328ae 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -943,10 +943,6 @@ nvmm_init_vcpu(CPUState *cpu) } qcpu = g_malloc0(sizeof(*qcpu)); - if (qcpu == NULL) { - error_report("NVMM: Failed to allocate VCPU context."); - return -ENOMEM; - } ret = nvmm_vcpu_create(mach, cpu->cpu_index, &qcpu->vcpu); if (ret == -1) {