Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3597251pxb; Mon, 24 Jan 2022 13:09:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY9E+qn16+te228YdobvnzMCUkoq+BUMxHRZ/jb0HG2ytjjcG3DzozHj2GugykACrZSWjd X-Received: by 2002:a17:902:b586:b0:14b:6bab:55e3 with SMTP id a6-20020a170902b58600b0014b6bab55e3mr1787832pls.43.1643058545281; Mon, 24 Jan 2022 13:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058545; cv=none; d=google.com; s=arc-20160816; b=G3hrKrCkvROeT8yHM1binnBkn2HmvP4usggJnHJNavD05NMiZgEolD11YVDCtzu78z 4j4suiyI00NOkl+kl+W1QB93jGVsS5zlT3gVeeh7HOFEH8iG/tcbgIHbdE4jaDe4dTHE lYmQplZDMxjzkjptrM2b4qdcwJtLDGuC1wkIuOu7ILqwbBSVzLgyt4UYmWuCAMDa5qBu keGulZRQ4xvdGfKtetiXnDTGmnfr/Vxa9Acq8Smnimvc0pbxv7nE0wY+bWbq7Wc6KLwx g8Sx+PHVLIMIJbnejRg9fZwQVoZVtBspjNcQPRGYMQmU94qGsuZewXFIl5ctxL7uTLeK w8iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L26tR6cS1azDBTZaROsPNO+h9ScbTX0pb4AfSt3h68w=; b=Vnmkzmpc6bCDAyFuFvdzRDFC7yq5Uh+0d97/NP3I2GfzU2Inj6UeoudDltbpXghOoB d4+v9ZCdPMPfYduJt5pq5eWCJR9jTygxkUJtSVVf0dM1Sog0smDIwfvmF5rSx0mBL7p/ pqPRphmbZZaYhBv4A2DNkJVvbronZucY8oS0ZybMGmToCcZixnan7BREhOz0YTivEVG2 DbgFga+O1/SkGSx6UsY3EwkbtGEmDt67ZFovTj714V7JSwnd7sn0cnAYVbCyFtq/HVcC US9Cyl6JCa+eOKk2EbirG23vAYfpk6zFDQCy+tukcofzP8WRN2gftKSpPB7fpaA3UHvm 8bPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZTvOOshk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si380472pjc.115.2022.01.24.13.08.53; Mon, 24 Jan 2022 13:09:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZTvOOshk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385879AbiAXUem (ORCPT + 99 others); Mon, 24 Jan 2022 15:34:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355444AbiAXUNl (ORCPT ); Mon, 24 Jan 2022 15:13:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB41C06177B; Mon, 24 Jan 2022 11:36:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 66EA5B81240; Mon, 24 Jan 2022 19:36:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9101EC340E5; Mon, 24 Jan 2022 19:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052987; bh=DwA8F4zgidWixlK9aMmqBvtZBvHnXYpCKUEafJu47RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZTvOOshk5hQ6UsvXBv0IMxJ8H/JwMw9S5qUue72dp292lcluK5Y4Oe6mKcTwBeXaD YtMyWJ3xnFfVYjkUDhMLNQjU2T2dBPuG6c4BXCIEj7LpftfD21BY2W1cpZnibwIcM8 rOSexMgxfDcduUsf4G3L+XoVqoMK11DfYpZuDPvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Asselstine , "Rafael J. Wysocki" , Bob Moore , Sasha Levin Subject: [PATCH 5.4 205/320] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:43:09 +0100 Message-Id: <20220124184000.602696831@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki [ Upstream commit 1cdfe9e346b4c5509ffe19ccde880fd259d9f7a3 ] ACPICA commit c11af67d8f7e3d381068ce7771322f2b5324d687 If original_count is 0 in acpi_ut_update_ref_count (), acpi_ut_delete_internal_obj () is invoked for the target object, which is incorrect, because that object has been deleted once already and the memory allocated to store it may have been reclaimed and allocated for a different purpose by the host OS. Moreover, a confusing debug message following the "Reference Count is already zero, cannot decrement" warning is printed in that case. To fix this issue, make acpi_ut_update_ref_count () return after finding that original_count is 0 and printing the above warning. Link: https://github.com/acpica/acpica/commit/c11af67d Link: https://github.com/acpica/acpica/pull/652 Reported-by: Mark Asselstine Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/utdelete.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index 72d2c0b656339..cb1750e7a6281 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c @@ -422,6 +422,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) ACPI_WARNING((AE_INFO, "Obj %p, Reference Count is already zero, cannot decrement\n", object)); + return; } ACPI_DEBUG_PRINT_RAW((ACPI_DB_ALLOCATIONS, -- 2.34.1