From nobody Tue Nov 26 20:01:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005535; cv=none; d=zohomail.com; s=zohoarc; b=SNxQe9ChXtlsu8KUpiGUq5KaZrwhmo6TlWZDC0MS529z/0/lo9xssLV1uXQXhCj18unCz+Vdvmuqn/NEKRrzwpnQc/Vw6Tw8pGoI3kzFuLWz1ay5U0HOmwI5ZqSi03657HGQnxkc4RgAi1FtY/kwsTBAQcI2MfK+9a68qdJF9nQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005535; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8KxhZwbZAcm1asBjHob1LgeGTJkXdHPPGTQpwmtvThw=; b=h/+7OzuPaeCh2uCRl3I6vbpxS+KYgqshYIn1qlegclXRiB8itdk5vaDuy/Id7pthYMXjS8AkPlV3bqBuYJ3Ke9EK+e8ElLcTHxDquznmA1ESCCIqZz3VZ5JS/xTRd666AXDq6aBLEILTEQrkPyTVE0xcX8tmZHljUao1bBuwrmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005535900965.8177652327137; Tue, 23 Jan 2024 02:25:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxC-0000N9-A3; Tue, 23 Jan 2024 05:24:26 -0500 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 1rSDxA-0000MX-3M for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:24 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDx8-0004cA-BV for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:23 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6dd7c5437b0so274851b3a.3 for ; Tue, 23 Jan 2024 02:24:21 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005460; x=1706610260; darn=nongnu.org; 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=8KxhZwbZAcm1asBjHob1LgeGTJkXdHPPGTQpwmtvThw=; b=VDKntUHDe81VJEdB00Nl1mv1yloJGfFuvqU1j00MIgIaeXvAlZ04mK6jNUdjaDBEj4 l+8d9p/0h6tJLdTYoNacGce4qwcFvTU7aiIAtSrQeKZF1gOZG3ZIc9mK7DloxXDocQVL /uOhBU62I2cqb8SP4LHV7K/Nw48A0INZ+kig1T6GoroYKkDCUn52pm724RcHdPFRaR34 gtROoXWviTfpasy7fYgo2wqAHrMS9v0fqy9F1qKlLGgGrwBg0gtiVViIkiH17a4VP88r CfTYj1lnIdrk5C94eALwLTQzSgDfT51Zre1oG4wSbvasU8UPX4FHTtxMO2f/5PnjOxUN RcPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005460; x=1706610260; 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=8KxhZwbZAcm1asBjHob1LgeGTJkXdHPPGTQpwmtvThw=; b=VZb6iJnnnIakva1VS5ipfWvtT12wr74BRANZB4wX18Pz2Dy5g4qOJbzIn0RPm+XD9Y EeW8BlrXuIwgvAeuus8VbkDRuDtxHW01Q1r8ZQZeDcFcUZ/xoBTY7hlu6wkf5Tmjtj+I iFC4kfZoaaQhYW3YM1hc0FEPyksLXIOAwrrZtxuAkVM23CWeG/xykNA/mRpGXANfYGGr adIg8MZgJxVGwEHa7ljBD88R/aBgngIEg7HKckTQ9vhsp+jbVBl0PkBScj3ny+PVduIf hpgD7m8+CKNCFF1M7tHwXMB6P2SK/H5HODB9OphB0eNTdSMDn8HU15fjYBBTv5b8st01 a+pA== X-Gm-Message-State: AOJu0YxraZFqkFicAqtJt+n/WMT+tuqqnrSCzASCvVIZhimvH5/ubyig odQkcC6HrLPtNQDga6zV592yH+d88TBep+WA36lQBP+O/9zkavc/lNdPwLbAiqaww8wUxsfrh39 Fo/k= X-Google-Smtp-Source: AGHT+IFbEITn4mA6lPyn6EPMoU5EJzjrqY6lMlUcma+KbLrF6SNmFFpxiU91cKUGgNpSwj5myZMDlA== X-Received: by 2002:a05:6a20:da83:b0:19a:29a4:4994 with SMTP id iy3-20020a056a20da8300b0019a29a44994mr6959060pzb.84.1706005460639; Tue, 23 Jan 2024 02:24:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Samuel Tardieu , Peter Maydell Subject: [PULL v2 1/8] tcg: Remove unreachable code Date: Tue, 23 Jan 2024 20:24:05 +1000 Message-Id: <20240123102412.4569-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005537898100007 Content-Type: text/plain; charset="utf-8" From: Samuel Tardieu The `fail_rx`/`fail` block is only entered while `buf_rx` is equal to its initial value `MAP_FAILED`. The `munmap(buf_rx, size);` was never executed. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2030 Signed-off-by: Samuel Tardieu Reviewed-by: Peter Maydell Message-Id: <20231219182212.455952-2-sam@rfc1149.net> Signed-off-by: Richard Henderson --- tcg/region.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 86692455c0..467e51cf6f 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -597,9 +597,7 @@ static int alloc_code_gen_buffer_splitwx_memfd(size_t s= ize, Error **errp) fail_rx: error_setg_errno(errp, errno, "failed to map shared memory for execute= "); fail: - if (buf_rx !=3D MAP_FAILED) { - munmap(buf_rx, size); - } + /* buf_rx is always equal to MAP_FAILED here and does not require clea= nup */ if (buf_rw) { munmap(buf_rw, size); } --=20 2.34.1